Skip to content

Commit

Permalink
read from the reader when it's not http
Browse files Browse the repository at this point in the history
  • Loading branch information
WeidiDeng committed Nov 20, 2023
1 parent 0309ad2 commit 4d36ca4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/caddyhttp/httpredirectlistener.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ func (c *httpRedirectConn) Read(p []byte) (int, error) {

// If the request doesn't look like HTTP, then it's probably
// TLS bytes, and we don't need to do anything.
// 0, nil are valid return values - caller most likely will try again.
if !firstBytesLookLikeHTTP(firstBytes) {
return 0, nil
return c.r.Read(p)
}

// From now on, we can be almost certain the request is HTTP.
Expand Down

0 comments on commit 4d36ca4

Please sign in to comment.