comparison src/http/modules/ngx_http_proxy_module.c @ 7881:52338ddf9e2f

Disabled spaces in URIs (ticket #196). From now on, requests with spaces in URIs are immediately rejected rather than allowed. Spaces were allowed in 31e9677b15a1 (0.8.41) to handle bad clients. It is believed that now this behaviour causes more harm than good.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 28 Jun 2021 18:01:13 +0300
parents 3ab8e1e2f0f7
children b87b7092cedb
comparison
equal deleted inserted replaced
7880:dfd8dfb436e5 7881:52338ddf9e2f
1184 return NGX_OK; 1184 return NGX_OK;
1185 } 1185 }
1186 1186
1187 loc_len = (r->valid_location && ctx->vars.uri.len) ? plcf->location.len : 0; 1187 loc_len = (r->valid_location && ctx->vars.uri.len) ? plcf->location.len : 0;
1188 1188
1189 if (r->quoted_uri || r->space_in_uri || r->internal) { 1189 if (r->quoted_uri || r->internal) {
1190 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len, 1190 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
1191 r->uri.len - loc_len, NGX_ESCAPE_URI); 1191 r->uri.len - loc_len, NGX_ESCAPE_URI);
1192 } else { 1192 } else {
1193 escape = 0; 1193 escape = 0;
1194 } 1194 }
1297 1297
1298 } else { 1298 } else {
1299 loc_len = (r->valid_location && ctx->vars.uri.len) ? 1299 loc_len = (r->valid_location && ctx->vars.uri.len) ?
1300 plcf->location.len : 0; 1300 plcf->location.len : 0;
1301 1301
1302 if (r->quoted_uri || r->space_in_uri || r->internal) { 1302 if (r->quoted_uri || r->internal) {
1303 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len, 1303 escape = 2 * ngx_escape_uri(NULL, r->uri.data + loc_len,
1304 r->uri.len - loc_len, NGX_ESCAPE_URI); 1304 r->uri.len - loc_len, NGX_ESCAPE_URI);
1305 } 1305 }
1306 1306
1307 uri_len = ctx->vars.uri.len + r->uri.len - loc_len + escape 1307 uri_len = ctx->vars.uri.len + r->uri.len - loc_len + escape