Skip to content

Commit

Permalink
Fixed header "Content-Length: 0" (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: Florian Lottes <[email protected]>
  • Loading branch information
flottes and Florian Lottes authored Feb 22, 2021
1 parent f714848 commit ad54c2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ func (e *Entry) writePublicResponse(w http.ResponseWriter) error {

if length == "" {
contentLength := strconv.Itoa(e.Response.body.Length())
w.Header().Set("Content-Length", contentLength)
if contentLength != "0" {
w.Header().Set("Content-Length", contentLength)
}
}

// wow, we should write the header before calling this function
Expand Down

0 comments on commit ad54c2d

Please sign in to comment.