Mercurial > hg > nginx
comparison src/http/ngx_http_header_filter_module.c @ 6852:d15172ebb400
Core: relative redirects (closes #1000).
The current version of HTTP/1.1 standard allows relative references in
redirects (https://tools.ietf.org/html/rfc7231#section-7.1.2).
Allow this form for redirects generated by nginx by introducing the new
directive absolute_redirect.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 21 Dec 2016 23:10:51 +0300 |
parents | b3b7e33083ac |
children | 25203fc377fb |
comparison
equal
deleted
inserted
replaced
6851:8cd97c14b0e2 | 6852:d15172ebb400 |
---|---|
307 | 307 |
308 c = r->connection; | 308 c = r->connection; |
309 | 309 |
310 if (r->headers_out.location | 310 if (r->headers_out.location |
311 && r->headers_out.location->value.len | 311 && r->headers_out.location->value.len |
312 && r->headers_out.location->value.data[0] == '/') | 312 && r->headers_out.location->value.data[0] == '/' |
313 && clcf->absolute_redirect) | |
313 { | 314 { |
314 r->headers_out.location->hash = 0; | 315 r->headers_out.location->hash = 0; |
315 | 316 |
316 if (clcf->server_name_in_redirect) { | 317 if (clcf->server_name_in_redirect) { |
317 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); | 318 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); |