mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
reverseproxy: Reset Content-Length to prevent FastCGI from hanging (#5435)
Fixes: https://github.com/caddyserver/caddy/issues/5420
This commit is contained in:
parent
a7af7c486e
commit
2182270a2c
1 changed files with 2 additions and 1 deletions
|
@ -646,7 +646,8 @@ func (h Handler) prepareRequest(req *http.Request, repl *caddy.Replacer) (*http.
|
||||||
// feature if absolutely required, if read timeouts are
|
// feature if absolutely required, if read timeouts are
|
||||||
// set, and if body size is limited
|
// set, and if body size is limited
|
||||||
if h.RequestBuffers != 0 && req.Body != nil {
|
if h.RequestBuffers != 0 && req.Body != nil {
|
||||||
req.Body, _ = h.bufferedBody(req.Body, h.RequestBuffers)
|
req.Body, req.ContentLength = h.bufferedBody(req.Body, h.RequestBuffers)
|
||||||
|
req.Header.Set("Content-Length", strconv.FormatInt(req.ContentLength, 10))
|
||||||
}
|
}
|
||||||
|
|
||||||
if req.ContentLength == 0 {
|
if req.ContentLength == 0 {
|
||||||
|
|
Loading…
Reference in a new issue