Mercurial > hg > nginx
diff src/http/ngx_http_special_response.c @ 3781:173a45374a97
allow override redirect status in error_page
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 18 Oct 2010 10:14:00 +0000 |
parents | 4a643a230686 |
children | 11c68a5ed419 |
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c Thu Oct 14 09:20:01 2010 +0000 +++ b/src/http/ngx_http_special_response.c Mon Oct 18 10:14:00 2010 +0000 @@ -523,7 +523,9 @@ r->expect_tested = 1; } - r->err_status = overwrite; + if (overwrite >= 0) { + r->err_status = overwrite; + } if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { return NGX_ERROR; @@ -556,7 +558,7 @@ return NGX_ERROR; } - r->err_status = NGX_HTTP_MOVED_TEMPORARILY; + r->err_status = overwrite > 0 ? overwrite : NGX_HTTP_MOVED_TEMPORARILY; location->hash = 1; ngx_str_set(&location->key, "Location"); @@ -570,7 +572,7 @@ return ngx_http_send_refresh(r); } - return ngx_http_send_special_response(r, clcf, NGX_HTTP_MOVED_TEMPORARILY + return ngx_http_send_special_response(r, clcf, r->err_status - NGX_HTTP_MOVED_PERMANENTLY + NGX_HTTP_LEVEL_200); }