Mercurial > hg > nginx
diff src/http/modules/ngx_http_static_module.c @ 4206:1a94a56a4e5d
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 12 Oct 2011 13:28:03 +0000 |
parents | 84905c7b2aa7 |
children | d620f497c50f |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_static_module.c Wed Oct 12 13:24:59 2011 +0000 +++ b/src/http/modules/ngx_http_static_module.c Wed Oct 12 13:28:03 2011 +0000 @@ -139,6 +139,8 @@ 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;