comparison 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
comparison
equal deleted inserted replaced
4205:26c307b8dc3c 4206:1a94a56a4e5d
137 137
138 if (of.is_dir) { 138 if (of.is_dir) {
139 139
140 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir"); 140 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http dir");
141 141
142 ngx_http_clear_location(r);
143
142 r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t)); 144 r->headers_out.location = ngx_palloc(r->pool, sizeof(ngx_table_elt_t));
143 if (r->headers_out.location == NULL) { 145 if (r->headers_out.location == NULL) {
144 return NGX_HTTP_INTERNAL_SERVER_ERROR; 146 return NGX_HTTP_INTERNAL_SERVER_ERROR;
145 } 147 }
146 148