Fix inverted error condition in gzipResponseWriter.init()

This commit is contained in:
lukema95 2025-10-13 12:37:05 +08:00
parent 659342a523
commit b989660f9b
No known key found for this signature in database

View file

@ -500,7 +500,7 @@ func (w *gzipResponseWriter) init() {
hdr := w.resp.Header()
length := hdr.Get("content-length")
if len(length) > 0 {
if n, err := strconv.ParseUint(length, 10, 64); err != nil {
if n, err := strconv.ParseUint(length, 10, 64); err == nil {
w.hasLength = true
w.contentLength = n
}