diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2016-12-16 11:06:29 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2016-12-16 16:58:04 -0500 |
commit | 4d7f5737f150c4bab8d3832bab9da62eddfea7d2 (patch) | |
tree | 3f5e56edf1e30f1a8da842e28ca283f196e8560b /src/mod_proxy.c | |
parent | f792d84cf9d16e8089aef7206b4a60d31c11ad55 (diff) | |
download | lighttpd-git-4d7f5737f150c4bab8d3832bab9da62eddfea7d2.tar.gz |
[core] support Transfer-Encoding: chunked req body (fixes #2156)
support Transfer-Encoding: chunked request body in conjunction with
server.stream-request-body = 0
dynamic handlers will still return 411 Length Required if
server.stream-request-body = 1 or 2 (!= 0)
since CGI-like env requires CONTENT_LENGTH be set
(and mod_proxy currently sends HTTP/1.0 requests to backends,
and Content-Length recommended for robust interaction with backend)
x-ref:
"request: support Chunked Transfer Coding for HTTP PUT"
https://redmine.lighttpd.net/issues/2156
Diffstat (limited to 'src/mod_proxy.c')
-rw-r--r-- | src/mod_proxy.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mod_proxy.c b/src/mod_proxy.c index a916fae6..2881efce 100644 --- a/src/mod_proxy.c +++ b/src/mod_proxy.c @@ -1169,6 +1169,15 @@ SUBREQUEST_FUNC(mod_proxy_handle_subrequest) { } } if (r != HANDLER_GO_ON) return r; + + /* mod_proxy sends HTTP/1.0 request and ideally should send + * Content-Length with request if request body is present, so + * send 411 Length Required if Content-Length missing. + * (occurs here if client sends Transfer-Encoding: chunked + * and module is flagged to stream request body to backend) */ + if (-1 == con->request.content_length) { + return connection_handle_read_post_error(srv, con, 411); + } } } |