aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/caddyhttp/encode/encode.go
diff options
context:
space:
mode:
authorWeidiDeng <[email protected]>2024-12-20 09:13:31 +0800
committerWeidiDeng <[email protected]>2024-12-20 09:13:31 +0800
commitc856aa10f84c64db3fe9ccec7ad5722d0cd0eaa1 (patch)
tree2f52e9792834e06dde140d4dee7996c53bd6d94e /modules/caddyhttp/encode/encode.go
parentbb4f0aec8d1d096566071871330da117c94533a7 (diff)
downloadcaddy-encode-sendfile.tar.gz
caddy-encode-sendfile.zip
remove connect check since it's done in Write methodencode-sendfile
Diffstat (limited to 'modules/caddyhttp/encode/encode.go')
-rw-r--r--modules/caddyhttp/encode/encode.go6
1 files changed, 0 insertions, 6 deletions
diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go
index 01c8f8ded..bea86083a 100644
--- a/modules/caddyhttp/encode/encode.go
+++ b/modules/caddyhttp/encode/encode.go
@@ -360,12 +360,6 @@ const sniffLen = 512
// It's based on stdlin http1.1 response writer implementation.
// https://github.com/golang/go/blob/f4e3ec3dbe3b8e04a058d266adf8e048bab563f2/src/net/http/server.go#L586
func (rw *responseWriter) ReadFrom(r io.Reader) (int64, error) {
- // WriteHeader wasn't called and is a CONNECT request, treat it as a success.
- // otherwise, determine if the response should be compressed.
- if rw.isConnect && !rw.wroteHeader && rw.statusCode == 0 {
- rw.WriteHeader(http.StatusOK)
- }
-
rf, ok := rw.ResponseWriter.(io.ReaderFrom)
// sendfile can't be used anyway
if !ok {