summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/encode/encode.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/encode/encode.go')
-rw-r--r--modules/caddyhttp/encode/encode.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/caddyhttp/encode/encode.go b/modules/caddyhttp/encode/encode.go
index e20667f..b7ab737 100644
--- a/modules/caddyhttp/encode/encode.go
+++ b/modules/caddyhttp/encode/encode.go
@@ -157,7 +157,11 @@ func (rw *responseWriter) init() {
rw.Header().Set("Content-Encoding", rw.encodingName)
}
rw.Header().Del("Accept-Ranges") // we don't know ranges for dynamically-encoded content
- rw.ResponseWriter.WriteHeader(rw.statusCode)
+ status := rw.statusCode
+ if status == 0 {
+ status = http.StatusOK
+ }
+ rw.ResponseWriter.WriteHeader(status)
}
// Close writes any remaining buffered response and