Skip to content

Commit

Permalink
Read both Content-Length header and req.ContentLength
Browse files Browse the repository at this point in the history
  • Loading branch information
cseufert authored and yookoala committed Jan 30, 2024
1 parent 9176ab4 commit db8a231
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ func BasicParamsMap(inner SessionHandler) SessionHandler {

// the basic information here
req.Params["CONTENT_TYPE"] = r.Header.Get("Content-Type")
req.Params["CONTENT_LENGTH"] = r.Header.Get("Content-Length")
cl := r.Header.Get("Content-Length")
if cl == "" {
cl = strconv.FormatInt(r.ContentLength, 10)
}
req.Params["CONTENT_LENGTH"] = cl
req.Params["GATEWAY_INTERFACE"] = "CGI/1.1"
req.Params["REMOTE_ADDR"] = remoteAddr
req.Params["REMOTE_PORT"] = remotePort
Expand Down

0 comments on commit db8a231

Please sign in to comment.