Mercurial > hg > nginx-quic
view docs/dtd/module.dtd @ 4147:7f64de1cc2c0
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 27 Sep 2011 11:11:30 +0000 |
parents | 5e2103cffd80 |
children |
line wrap: on
line source
<!ELEMENT module (section+) > <!ATTLIST module name CDATA #REQUIRED id ID #REQUIRED > <!ELEMENT section (directive | para)+ > <!ATTLIST section name CDATA #REQUIRED id ID #IMPLIED > <!ELEMENT directive (syntax+, default, context+, para+) > <!ATTLIST directive name ID #REQUIRED appeared-in CDATA #IMPLIED > <!ELEMENT syntax (#PCDATA | argument | code | parameter | value)* > <!ELEMENT default (#PCDATA | code)* > <!ELEMENT context (#PCDATA)* > <!ELEMENT para (#PCDATA | argument | c-def | c-func | code | command | dq | emphasis | example | header | http-status | link | list | note | parameter | pathname | value | var)* > <!ELEMENT argument (#PCDATA)* > <!ELEMENT c-def (#PCDATA)* > <!ELEMENT c-func (#PCDATA)* > <!ELEMENT code (#PCDATA | value)* > <!ELEMENT command (#PCDATA)* > <!ELEMENT dq ANY > <!ELEMENT emphasis (#PCDATA)* > <!ELEMENT example (#PCDATA)* > <!ELEMENT header (#PCDATA | argument)* > <!ELEMENT http-status EMPTY > <!ATTLIST http-status code CDATA #REQUIRED text CDATA #IMPLIED > <!ELEMENT link (#PCDATA)* > <!ATTLIST link doc CDATA #IMPLIED id CDATA #IMPLIED url CDATA #IMPLIED > <!ELEMENT list (listitem+ | (tag-name | tag-desc)+) > <!ATTLIST list type (bullet | enum | tag) #REQUIRED > <!ELEMENT listitem ANY > <!ELEMENT tag-name ANY > <!ELEMENT tag-desc ANY > <!ELEMENT note ANY > <!ELEMENT parameter (#PCDATA)* > <!ELEMENT pathname (#PCDATA)* > <!ELEMENT value (#PCDATA)* > <!ELEMENT var (#PCDATA)* > <!ENTITY nbsp " " > <!ENTITY mdash " - " > <!ENTITY lsquo "‘"> <!ENTITY rsquo "’"> <!ENTITY ldquo "“"> <!ENTITY rdquo "”">