comparison 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
comparison
equal deleted inserted replaced
4490:0cc1b430a0e6 4491:d11f86a16e3b
72 "<body bgcolor=\"white\">" CRLF 72 "<body bgcolor=\"white\">" CRLF
73 "<center><h1>303 See Other</h1></center>" CRLF 73 "<center><h1>303 See Other</h1></center>" CRLF
74 ; 74 ;
75 75
76 76
77 static char ngx_http_error_307_page[] =
78 "<html>" CRLF
79 "<head><title>307 Temporary Redirect</title></head>" CRLF
80 "<body bgcolor=\"white\">" CRLF
81 "<center><h1>307 Temporary Redirect</h1></center>" CRLF
82 ;
83
84
77 static char ngx_http_error_400_page[] = 85 static char ngx_http_error_400_page[] =
78 "<html>" CRLF 86 "<html>" CRLF
79 "<head><title>400 Bad Request</title></head>" CRLF 87 "<head><title>400 Bad Request</title></head>" CRLF
80 "<body bgcolor=\"white\">" CRLF 88 "<body bgcolor=\"white\">" CRLF
81 "<center><h1>400 Bad Request</h1></center>" CRLF 89 "<center><h1>400 Bad Request</h1></center>" CRLF
299 307
300 /* ngx_null_string, */ /* 300 */ 308 /* ngx_null_string, */ /* 300 */
301 ngx_string(ngx_http_error_301_page), 309 ngx_string(ngx_http_error_301_page),
302 ngx_string(ngx_http_error_302_page), 310 ngx_string(ngx_http_error_302_page),
303 ngx_string(ngx_http_error_303_page), 311 ngx_string(ngx_http_error_303_page),
304 312 ngx_null_string, /* 304 */
305 #define NGX_HTTP_LAST_3XX 304 313 ngx_null_string, /* 305 */
314 ngx_null_string, /* 306 */
315 ngx_string(ngx_http_error_307_page),
316
317 #define NGX_HTTP_LAST_3XX 308
306 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX) 318 #define NGX_HTTP_OFF_4XX (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
307 319
308 ngx_string(ngx_http_error_400_page), 320 ngx_string(ngx_http_error_400_page),
309 ngx_string(ngx_http_error_401_page), 321 ngx_string(ngx_http_error_401_page),
310 ngx_string(ngx_http_error_402_page), 322 ngx_string(ngx_http_error_402_page),
565 577
566 if (location == NULL) { 578 if (location == NULL) {
567 return NGX_ERROR; 579 return NGX_ERROR;
568 } 580 }
569 581
570 if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY 582 if (overwrite != NGX_HTTP_MOVED_PERMANENTLY
571 && overwrite <= NGX_HTTP_SEE_OTHER) 583 && overwrite != NGX_HTTP_MOVED_TEMPORARILY
584 && overwrite != NGX_HTTP_SEE_OTHER
585 && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)
572 { 586 {
573 r->err_status = overwrite;
574
575 } else {
576 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; 587 r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
577 } 588 }
578 589
579 location->hash = 1; 590 location->hash = 1;
580 ngx_str_set(&location->key, "Location"); 591 ngx_str_set(&location->key, "Location");