merge_slashes
Igor Sysoev
14 years ago
63 | 63 |
#endif
|
64 | 64 |
|
65 | 65 |
ngx_int_t ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b);
|
66 | |
ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r);
|
|
66 |
ngx_int_t ngx_http_parse_complex_uri(ngx_http_request_t *r,
|
|
67 |
ngx_uint_t merge_slashes);
|
67 | 68 |
ngx_int_t ngx_http_parse_unsafe_uri(ngx_http_request_t *r, ngx_str_t *uri,
|
68 | 69 |
ngx_str_t *args, ngx_uint_t *flags);
|
69 | 70 |
ngx_int_t ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b);
|
184 | 184 |
offsetof(ngx_http_core_srv_conf_t, ignore_invalid_headers),
|
185 | 185 |
NULL },
|
186 | 186 |
|
|
187 |
{ ngx_string("merge_slashes"),
|
|
188 |
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_FLAG,
|
|
189 |
ngx_conf_set_flag_slot,
|
|
190 |
NGX_HTTP_SRV_CONF_OFFSET,
|
|
191 |
offsetof(ngx_http_core_srv_conf_t, merge_slashes),
|
|
192 |
NULL },
|
|
193 |
|
187 | 194 |
{ ngx_string("location"),
|
188 | 195 |
NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_BLOCK|NGX_CONF_TAKE12,
|
189 | 196 |
ngx_http_core_location,
|
|
2232 | 2239 |
cscf->client_header_buffer_size = NGX_CONF_UNSET_SIZE;
|
2233 | 2240 |
cscf->optimize_server_names = NGX_CONF_UNSET;
|
2234 | 2241 |
cscf->ignore_invalid_headers = NGX_CONF_UNSET;
|
|
2242 |
cscf->merge_slashes = NGX_CONF_UNSET;
|
2235 | 2243 |
|
2236 | 2244 |
return cscf;
|
2237 | 2245 |
}
|
|
2323 | 2331 |
|
2324 | 2332 |
ngx_conf_merge_value(conf->ignore_invalid_headers,
|
2325 | 2333 |
prev->ignore_invalid_headers, 1);
|
|
2334 |
|
|
2335 |
ngx_conf_merge_value(conf->merge_slashes, prev->merge_slashes, 1);
|
2326 | 2336 |
|
2327 | 2337 |
return NGX_CONF_OK;
|
2328 | 2338 |
}
|
601 | 601 |
static void
|
602 | 602 |
ngx_http_process_request_line(ngx_event_t *rev)
|
603 | 603 |
{
|
604 | |
ssize_t n;
|
605 | |
ngx_int_t rc, rv;
|
606 | |
ngx_connection_t *c;
|
607 | |
ngx_http_request_t *r;
|
|
604 |
ssize_t n;
|
|
605 |
ngx_int_t rc, rv;
|
|
606 |
ngx_connection_t *c;
|
|
607 |
ngx_http_request_t *r;
|
|
608 |
ngx_http_core_srv_conf_t *cscf;
|
608 | 609 |
|
609 | 610 |
c = rev->data;
|
610 | 611 |
r = c->data;
|
|
656 | 657 |
return;
|
657 | 658 |
}
|
658 | 659 |
|
659 | |
rc = ngx_http_parse_complex_uri(r);
|
|
660 |
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
|
|
661 |
|
|
662 |
rc = ngx_http_parse_complex_uri(r, cscf->merge_slashes);
|
660 | 663 |
|
661 | 664 |
if (rc == NGX_HTTP_PARSE_INVALID_REQUEST) {
|
662 | 665 |
ngx_log_error(NGX_LOG_INFO, c->log, 0,
|