Mercurial > hg > nginx
diff src/http/ngx_http_special_response.c @ 4491:d11f86a16e3b
Added support for the 307 Temporary Redirect.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 27 Feb 2012 11:43:40 +0000 |
parents | 0cc1b430a0e6 |
children | 4a18bf1833a9 7556a7acb14f |
line wrap: on
line diff
--- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -74,6 +74,14 @@ static char ngx_http_error_303_page[] = ; +static char ngx_http_error_307_page[] = +"<html>" CRLF +"<head><title>307 Temporary Redirect</title></head>" CRLF +"<body bgcolor=\"white\">" CRLF +"<center><h1>307 Temporary Redirect</h1></center>" CRLF +; + + static char ngx_http_error_400_page[] = "<html>" CRLF "<head><title>400 Bad Request</title></head>" CRLF @@ -301,8 +309,12 @@ static ngx_str_t ngx_http_error_pages[] ngx_string(ngx_http_error_301_page), ngx_string(ngx_http_error_302_page), ngx_string(ngx_http_error_303_page), + ngx_null_string, /* 304 */ + ngx_null_string, /* 305 */ + ngx_null_string, /* 306 */ + ngx_string(ngx_http_error_307_page), -#define NGX_HTTP_LAST_3XX 304 +#define NGX_HTTP_LAST_3XX 308 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) ngx_string(ngx_http_error_400_page), @@ -567,12 +579,11 @@ ngx_http_send_error_page(ngx_http_reques return NGX_ERROR; } - if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY - && overwrite <= NGX_HTTP_SEE_OTHER) + if (overwrite != NGX_HTTP_MOVED_PERMANENTLY + && overwrite != NGX_HTTP_MOVED_TEMPORARILY + && overwrite != NGX_HTTP_SEE_OTHER + && overwrite != NGX_HTTP_TEMPORARY_REDIRECT) { - r->err_status = overwrite; - - } else { r->err_status = NGX_HTTP_MOVED_TEMPORARILY; }