From 72df0f400a4f6144f9c69add91002a0ff02cfe41 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Wed, 12 Oct 2011 13:28:03 +0000 Subject: 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. --- src/http/modules/ngx_http_static_module.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/http/modules/ngx_http_static_module.c') 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; -- cgit