diff options
author | Ruslan Ermilov <ru@nginx.com> | 2012-02-27 11:43:40 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@nginx.com> | 2012-02-27 11:43:40 +0000 |
commit | 1c57fb87905926519e2aef149b645d069328489e (patch) | |
tree | cacc864ff57273b5c20c678b85d82a716632bfc1 /src/http/ngx_http_special_response.c | |
parent | 09422e632f5768d1de432e4a3cef9459b685418c (diff) | |
download | nginx-1c57fb87905926519e2aef149b645d069328489e.tar.gz nginx-1c57fb87905926519e2aef149b645d069328489e.zip |
Added support for the 307 Temporary Redirect.
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r-- | src/http/ngx_http_special_response.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index d481d0908..77b3dd13f 100644 --- 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_request_t *r, ngx_http_err_page_t *err_page) 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; } |