comparison src/http/v2/ngx_http_v2_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 3834951e32ab
children 25203fc377fb
comparison
equal deleted inserted replaced
6851:8cd97c14b0e2 6852:d15172ebb400
261 len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT"); 261 len += 1 + ngx_http_v2_literal_size("Wed, 31 Dec 1986 18:00:00 GMT");
262 } 262 }
263 263
264 if (r->headers_out.location && r->headers_out.location->value.len) { 264 if (r->headers_out.location && r->headers_out.location->value.len) {
265 265
266 if (r->headers_out.location->value.data[0] == '/') { 266 if (r->headers_out.location->value.data[0] == '/'
267 && clcf->absolute_redirect)
268 {
267 if (clcf->server_name_in_redirect) { 269 if (clcf->server_name_in_redirect) {
268 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module); 270 cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
269 host = cscf->server_name; 271 host = cscf->server_name;
270 272
271 } else if (r->headers_in.server.len) { 273 } else if (r->headers_in.server.len) {