]> git.kaiwu.me - nginx.git/commit
Removed incorrect optimization of HEAD requests.
authorMaxim Dounin <mdounin@mdounin.ru>
Tue, 19 Jan 2021 17:21:12 +0000 (20:21 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Tue, 19 Jan 2021 17:21:12 +0000 (20:21 +0300)
commitd2c0b9a6c7b0757d5d55db36b1ae656bba056a8c
tree7d2d200a13b85abfc6e9aa6c324d2fd28c706e72
parente1ca9851220bb6d5f8e6b967635078f35a423c7c
Removed incorrect optimization of HEAD requests.

The stub status module and ngx_http_send_response() (used by the empty gif
module and the "return" directive) incorrectly assumed that responding
to HEAD requests always results in r->header_only being set.  This is not
true, and results in incorrect behaviour, for example, in the following
configuration:

   location / {
       image_filter size;
       return 200 test;
   }

Fix is to remove this incorrect micro-optimization from both stub status
module and ngx_http_send_response().

Reported by Chris Newton.
src/http/modules/ngx_http_stub_status_module.c
src/http/ngx_http_core_module.c