diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2011-10-12 13:28:03 +0000 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2011-10-12 13:28:03 +0000 |
commit | 72df0f400a4f6144f9c69add91002a0ff02cfe41 (patch) | |
tree | 7956765c5ca64545280611b6843595d7e45e019d /src/http/modules/ngx_http_static_module.c | |
parent | 8650c1eb24f77773f04df3ed358897c39334a1bc (diff) | |
download | nginx-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/modules/ngx_http_static_module.c')
-rw-r--r-- | src/http/modules/ngx_http_static_module.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c index 57b5130d4..cea050a94 100644 --- a/src/http/modules/ngx_http_static_module.c +++ b/src/http/modules/ngx_http_static_module.c @@ -139,6 +139,8 @@ ngx_http_static_handler(ngx_http_request_t *r) ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir"); + ngx_http_clear_location(r); + r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t)); if (r->headers_out.location == NULL) { return NGX_HTTP_INTERNAL_SERVER_ERROR; |