Mercurial > hg > nginx
comparison src/http/ngx_http_upstream.c @ 5489:6d357b2a9d6e
Upstream: keep $upstream_http_x_accel_redirect intact.
When processing the X-Accel-Redirect header, the value of the
$upstream_http_x_accel_redirect variable was also overwritten.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Mon, 23 Dec 2013 18:11:46 +0400 |
parents | 98876ce2a7fd |
children | 6a3ab6fdd70f |
comparison
equal
deleted
inserted
replaced
5488:c51b9491b0bd | 5489:6d357b2a9d6e |
---|---|
1992 | 1992 |
1993 | 1993 |
1994 static ngx_int_t | 1994 static ngx_int_t |
1995 ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u) | 1995 ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u) |
1996 { | 1996 { |
1997 ngx_str_t *uri, args; | 1997 ngx_str_t uri, args; |
1998 ngx_uint_t i, flags; | 1998 ngx_uint_t i, flags; |
1999 ngx_list_part_t *part; | 1999 ngx_list_part_t *part; |
2000 ngx_table_elt_t *h; | 2000 ngx_table_elt_t *h; |
2001 ngx_http_upstream_header_t *hh; | 2001 ngx_http_upstream_header_t *hh; |
2002 ngx_http_upstream_main_conf_t *umcf; | 2002 ngx_http_upstream_main_conf_t *umcf; |
2033 return NGX_DONE; | 2033 return NGX_DONE; |
2034 } | 2034 } |
2035 } | 2035 } |
2036 } | 2036 } |
2037 | 2037 |
2038 uri = &u->headers_in.x_accel_redirect->value; | 2038 uri = u->headers_in.x_accel_redirect->value; |
2039 ngx_str_null(&args); | 2039 ngx_str_null(&args); |
2040 flags = NGX_HTTP_LOG_UNSAFE; | 2040 flags = NGX_HTTP_LOG_UNSAFE; |
2041 | 2041 |
2042 if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) { | 2042 if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) { |
2043 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); | 2043 ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND); |
2044 return NGX_DONE; | 2044 return NGX_DONE; |
2045 } | 2045 } |
2046 | 2046 |
2047 if (r->method != NGX_HTTP_HEAD) { | 2047 if (r->method != NGX_HTTP_HEAD) { |
2048 r->method = NGX_HTTP_GET; | 2048 r->method = NGX_HTTP_GET; |
2049 } | 2049 } |
2050 | 2050 |
2051 ngx_http_internal_redirect(r, uri, &args); | 2051 ngx_http_internal_redirect(r, &uri, &args); |
2052 ngx_http_finalize_request(r, NGX_DONE); | 2052 ngx_http_finalize_request(r, NGX_DONE); |
2053 return NGX_DONE; | 2053 return NGX_DONE; |
2054 } | 2054 } |
2055 | 2055 |
2056 part = &u->headers_in.headers.part; | 2056 part = &u->headers_in.headers.part; |