Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: keep $upstream_http_x_accel_redirect intact.

Ruslan Ermilov
December 23, 2013 09:14AM
details: http://hg.nginx.org/nginx/rev/6d357b2a9d6e
branches:
changeset: 5489:6d357b2a9d6e
user: Ruslan Ermilov <ru@nginx.com>
date: Mon Dec 23 18:11:46 2013 +0400
description:
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.

diffstat:

src/http/ngx_http_upstream.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r c51b9491b0bd -r 6d357b2a9d6e src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c Thu Dec 19 13:43:18 2013 +0400
+++ b/src/http/ngx_http_upstream.c Mon Dec 23 18:11:46 2013 +0400
@@ -1994,7 +1994,7 @@ ngx_http_upstream_test_connect(ngx_conne
static ngx_int_t
ngx_http_upstream_process_headers(ngx_http_request_t *r, ngx_http_upstream_t *u)
{
- ngx_str_t *uri, args;
+ ngx_str_t uri, args;
ngx_uint_t i, flags;
ngx_list_part_t *part;
ngx_table_elt_t *h;
@@ -2035,11 +2035,11 @@ ngx_http_upstream_process_headers(ngx_ht
}
}

- uri = &u->headers_in.x_accel_redirect->value;
+ uri = u->headers_in.x_accel_redirect->value;
ngx_str_null(&args);
flags = NGX_HTTP_LOG_UNSAFE;

- if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) {
+ if (ngx_http_parse_unsafe_uri(r, &uri, &args, &flags) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
return NGX_DONE;
}
@@ -2048,7 +2048,7 @@ ngx_http_upstream_process_headers(ngx_ht
r->method = NGX_HTTP_GET;
}

- ngx_http_internal_redirect(r, uri, &args);
+ ngx_http_internal_redirect(r, &uri, &args);
ngx_http_finalize_request(r, NGX_DONE);
return NGX_DONE;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Upstream: keep $upstream_http_x_accel_redirect intact.

Ruslan Ermilov 824 December 23, 2013 09:14AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 139
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready