Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
3780:d94d7104f598 | 3781:173a45374a97 |
---|---|
521 | 521 |
522 if (overwrite && overwrite != NGX_HTTP_OK) { | 522 if (overwrite && overwrite != NGX_HTTP_OK) { |
523 r->expect_tested = 1; | 523 r->expect_tested = 1; |
524 } | 524 } |
525 | 525 |
526 r->err_status = overwrite; | 526 if (overwrite >= 0) { |
527 r->err_status = overwrite; | |
528 } | |
527 | 529 |
528 if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { | 530 if (ngx_http_complex_value(r, &err_page->value, &uri) != NGX_OK) { |
529 return NGX_ERROR; | 531 return NGX_ERROR; |
530 } | 532 } |
531 | 533 |
554 | 556 |
555 if (location == NULL) { | 557 if (location == NULL) { |
556 return NGX_ERROR; | 558 return NGX_ERROR; |
557 } | 559 } |
558 | 560 |
559 r->err_status = NGX_HTTP_MOVED_TEMPORARILY; | 561 r->err_status = overwrite > 0 ? overwrite : NGX_HTTP_MOVED_TEMPORARILY; |
560 | 562 |
561 location->hash = 1; | 563 location->hash = 1; |
562 ngx_str_set(&location->key, "Location"); | 564 ngx_str_set(&location->key, "Location"); |
563 location->value = uri; | 565 location->value = uri; |
564 | 566 |
568 | 570 |
569 if (clcf->msie_refresh && r->headers_in.msie) { | 571 if (clcf->msie_refresh && r->headers_in.msie) { |
570 return ngx_http_send_refresh(r); | 572 return ngx_http_send_refresh(r); |
571 } | 573 } |
572 | 574 |
573 return ngx_http_send_special_response(r, clcf, NGX_HTTP_MOVED_TEMPORARILY | 575 return ngx_http_send_special_response(r, clcf, r->err_status |
574 - NGX_HTTP_MOVED_PERMANENTLY | 576 - NGX_HTTP_MOVED_PERMANENTLY |
575 + NGX_HTTP_LEVEL_200); | 577 + NGX_HTTP_LEVEL_200); |
576 } | 578 } |
577 | 579 |
578 | 580 |