Changeset 4491:d11f86a16e3b in nginx


Ignore:
Timestamp:
02/27/12 11:43:40 (8 years ago)
Author:
Ruslan Ermilov <ru@…>
Branch:
default
Phase:
public
Convert:
svn:c3fe7df1-7212-e011-8a91-001109144009/trunk@4492
Message:

Added support for the 307 Temporary Redirect.

Location:
src/http
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/http/modules/ngx_http_headers_filter_module.c

    r4474 r4491  
    150150            && r->headers_out.status != NGX_HTTP_MOVED_PERMANENTLY
    151151            && r->headers_out.status != NGX_HTTP_MOVED_TEMPORARILY
    152             && r->headers_out.status != NGX_HTTP_NOT_MODIFIED))
     152            && r->headers_out.status != NGX_HTTP_SEE_OTHER
     153            && r->headers_out.status != NGX_HTTP_NOT_MODIFIED
     154            && r->headers_out.status != NGX_HTTP_TEMPORARY_REDIRECT))
    153155    {
    154156        return ngx_http_next_header_filter(r);
  • src/http/modules/perl/nginx.pm

    r4483 r4491  
    2222    HTTP_MOVED_TEMPORARILY
    2323    HTTP_REDIRECT
     24    HTTP_SEE_OTHER
    2425    HTTP_NOT_MODIFIED
     26    HTTP_TEMPORARY_REDIRECT
    2527
    2628    HTTP_BAD_REQUEST
     
    6870use constant HTTP_MOVED_TEMPORARILY         => 302;
    6971use constant HTTP_REDIRECT                  => 302;
     72use constant HTTP_SEE_OTHER                 => 303;
    7073use constant HTTP_NOT_MODIFIED              => 304;
     74use constant HTTP_TEMPORARY_REDIRECT        => 307;
    7175
    7276use constant HTTP_BAD_REQUEST               => 400;
  • src/http/ngx_http_core_module.c

    r4477 r4491  
    18251825    }
    18261826
    1827     if (status >= NGX_HTTP_MOVED_PERMANENTLY && status <= NGX_HTTP_SEE_OTHER) {
    1828 
     1827    if (status == NGX_HTTP_MOVED_PERMANENTLY
     1828        || status == NGX_HTTP_MOVED_TEMPORARILY
     1829        || status == NGX_HTTP_SEE_OTHER
     1830        || status == NGX_HTTP_TEMPORARY_REDIRECT)
     1831    {
    18291832        ngx_http_clear_location(r);
    18301833
  • src/http/ngx_http_header_filter_module.c

    r4412 r4491  
    7272    ngx_string("303 See Other"),
    7373    ngx_string("304 Not Modified"),
    74 
    75     /* ngx_null_string, */  /* "305 Use Proxy" */
    76     /* ngx_null_string, */  /* "306 unused" */
    77     /* ngx_null_string, */  /* "307 Temporary Redirect" */
    78 
    79 #define NGX_HTTP_LAST_3XX  305
     74    ngx_null_string,  /* "305 Use Proxy" */
     75    ngx_null_string,  /* "306 unused" */
     76    ngx_string("307 Temporary Redirect"),
     77
     78#define NGX_HTTP_LAST_3XX  308
    8079#define NGX_HTTP_OFF_4XX   (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
    8180
  • src/http/ngx_http_request.h

    r4457 r4491  
    7676#define NGX_HTTP_SEE_OTHER                 303
    7777#define NGX_HTTP_NOT_MODIFIED              304
     78#define NGX_HTTP_TEMPORARY_REDIRECT        307
    7879
    7980#define NGX_HTTP_BAD_REQUEST               400
  • src/http/ngx_http_special_response.c

    r4490 r4491  
    7575
    7676
     77static 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
    7785static char ngx_http_error_400_page[] =
    7886"<html>" CRLF
     
    302310    ngx_string(ngx_http_error_302_page),
    303311    ngx_string(ngx_http_error_303_page),
    304 
    305 #define NGX_HTTP_LAST_3XX  304
     312    ngx_null_string,                     /* 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
    306318#define NGX_HTTP_OFF_4XX   (NGX_HTTP_LAST_3XX - 301 + NGX_HTTP_OFF_3XX)
    307319
     
    568580    }
    569581
    570     if (overwrite >= NGX_HTTP_MOVED_PERMANENTLY
    571         && overwrite <= NGX_HTTP_SEE_OTHER)
     582    if (overwrite != NGX_HTTP_MOVED_PERMANENTLY
     583        && overwrite != NGX_HTTP_MOVED_TEMPORARILY
     584        && overwrite != NGX_HTTP_SEE_OTHER
     585        && overwrite != NGX_HTTP_TEMPORARY_REDIRECT)
    572586    {
    573         r->err_status = overwrite;
    574 
    575     } else {
    576587        r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
    577588    }
Note: See TracChangeset for help on using the changeset viewer.