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/ngx_http_core_module.h | |
| parent | 8650c1eb24f77773f04df3ed358897c39334a1bc (diff) | |
| download | nginx-72df0f400a4f6144f9c69add91002a0ff02cfe41.tar.gz nginx-72df0f400a4f6144f9c69add91002a0ff02cfe41.tar.bz2 | |
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_core_module.h')
| -rw-r--r-- | src/http/ngx_http_core_module.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.h b/src/http/ngx_http_core_module.h index df20b5d3a..d2764fe0d 100644 --- a/src/http/ngx_http_core_module.h +++ b/src/http/ngx_http_core_module.h @@ -529,5 +529,12 @@ extern ngx_str_t ngx_http_core_get_method; r->headers_out.last_modified = NULL; \ } +#define ngx_http_clear_location(r) \ + \ + if (r->headers_out.location) { \ + r->headers_out.location->hash = 0; \ + r->headers_out.location = NULL; \ + } + #endif /* _NGX_HTTP_CORE_H_INCLUDED_ */ |
