aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_script.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-10-12 13:28:03 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-10-12 13:28:03 +0000
commit72df0f400a4f6144f9c69add91002a0ff02cfe41 (patch)
tree7956765c5ca64545280611b6843595d7e45e019d /src/http/ngx_http_script.c
parent8650c1eb24f77773f04df3ed358897c39334a1bc (diff)
downloadnginx-72df0f400a4f6144f9c69add91002a0ff02cfe41.tar.gz
nginx-72df0f400a4f6144f9c69add91002a0ff02cfe41.zip
Clear old Location header (if any) while adding a new one.
This prevents incorrect behaviour when another redirect is issued within error_page 302 handler.
Diffstat (limited to 'src/http/ngx_http_script.c')
-rw-r--r--src/http/ngx_http_script.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c
index a703f0837..6d81b4435 100644
--- a/src/http/ngx_http_script.c
+++ b/src/http/ngx_http_script.c
@@ -1106,6 +1106,8 @@ ngx_http_script_regex_end_code(ngx_http_script_engine_t *e)
"rewritten redirect: \"%V\"", &e->buf);
}
+ ngx_http_clear_location(r);
+
r->headers_out.location = ngx_list_push(&r->headers_out.headers);
if (r->headers_out.location == NULL) {
e->ip = ngx_http_script_exit;