]> git.kaiwu.me - nginx.git/commit
FastCGI: protection from responses with wrong length.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:23 +0000 (18:36 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 6 Jul 2020 15:36:23 +0000 (18:36 +0300)
commit1194ba36a0685efb0818d28dad5ef518949c910b
tree67ca6c4a1c4a26ba7b5287862686c060568fbb17
parentdfcfcc5a881bf4b349f74c9a0a04da2d861f02bf
FastCGI: protection from responses with wrong length.

Previous behaviour was to pass everything to the client, but this
seems to be suboptimal and causes issues (ticket #1695).  Fix is to
drop extra data instead, as it naturally happens in most clients.

Additionally, we now also issue a warning if the response is too
short, and make sure the fact it is truncated is propagated to the
client.  The u->error flag is introduced to make it possible to
propagate the error to the client in case of unbuffered proxying.

For responses to HEAD requests there is an exception: we do allow
both responses without body and responses with body matching the
Content-Length header.
src/http/modules/ngx_http_fastcgi_module.c
src/http/ngx_http_upstream.c
src/http/ngx_http_upstream.h