An official read-only mirror of http://hg.nginx.org/nginx/ which is updated hourly. Pull requests on GitHub cannot be accepted and will be automatically closed. The proper way to submit changes to nginx is via the nginx development mailing list, see http://nginx.org/en/docs/contributing_changes.html
Go to file
Maxim Dounin ad5ef15e08 Fix for double content when return is used in error_page handler.
Test case:

   location / {
       error_page 405 /nope;
       return 405;
   }

   location /nope {
       return 200;
   }

This is expected to return 405 with empty body, but in 0.8.42+ will return
builtin 405 error page as well (though not counted in Content-Length, thus
breaking protocol).

Fix is to use status provided by rewrite script execution in case
it's less than NGX_HTTP_BAD_REQUEST even if r->error_status set.  This
check is in line with one in ngx_http_script_return_code().

Note that this patch also changes behaviour for "return 302 ..." and
"rewrite ... redirect" used as error handler.  E.g.

    location / {
        error_page 405 /redirect;
        return 405;
    }

    location /redirect {
        rewrite ^ http://example.com/;
    }

will actually return redirect to "http://example.com/" instead of builtin 405
error page with meaningless Location header.  This looks like correct change
and it's in line with what happens on e.g. directory redirects in error
handlers.
2011-09-27 11:11:30 +00:00
auto Upstream keepalive module. 2011-09-15 19:28:18 +00:00
conf "video/mp4" mime type added. 2011-09-09 10:25:43 +00:00
contrib nginx-0.3.55-RELEASE import 2006-07-28 15:16:17 +00:00
docs Fixed markup. 2011-09-20 13:15:41 +00:00
misc Removing incomplete draft documentation from release tarball and zip. 2011-08-23 13:35:02 +00:00
src Fix for double content when return is used in error_page handler. 2011-09-27 11:11:30 +00:00
.hgtags release-1.1.4 tag 2011-09-20 11:18:32 +00:00