if (virt->http_stricturi != AP_HTTP_URI_UNSET)
conf->http_stricturi = virt->http_stricturi;
- if (virt->http_whitespace != AP_HTTP_WHITESPACE_UNSET)
- conf->http_whitespace = virt->http_whitespace;
-
if (virt->http_methods != AP_HTTP_METHODS_UNSET)
conf->http_methods = virt->http_methods;
conf->http_stricturi |= AP_HTTP_URI_STRICT;
else if (strcasecmp(arg, "unsafeuri") == 0)
conf->http_stricturi |= AP_HTTP_URI_UNSAFE;
- else if (strcasecmp(arg, "strictwhitespace") == 0)
- conf->http_whitespace |= AP_HTTP_WHITESPACE_STRICT;
- else if (strcasecmp(arg, "unsafewhitespace") == 0)
- conf->http_whitespace |= AP_HTTP_WHITESPACE_UNSAFE;
else if (strcasecmp(arg, "registeredmethods") == 0)
conf->http_methods |= AP_HTTP_METHODS_REGISTERED;
else if (strcasecmp(arg, "lenientmethods") == 0)
return "HttpProtocolOptions accepts "
"'Unsafe' or 'Strict' (default), "
"'UnsafeURI' or 'StrictURI' (default), "
- "'UnsafeWhitespace' or 'StrictWhitespace' (default), "
"'RegisteredMethods' or 'LenientMethods' (default), and "
"'Require1.0' or 'Allow0.9' (default)";
return "HttpProtocolOptions 'Strict' and 'Unsafe'"
" are mutually exclusive";
- if ((conf->http_whitespace & AP_HTTP_WHITESPACE_STRICT)
- && (conf->http_whitespace & AP_HTTP_WHITESPACE_UNSAFE))
- return "HttpProtocolOptions 'StrictWhitespace' and 'UnsafeWhitespace'"
- " are mutually exclusive";
-
if ((conf->http_methods & AP_HTTP_METHODS_REGISTERED)
&& (conf->http_methods & AP_HTTP_METHODS_LENIENT))
return "HttpProtocolOptions 'RegisteredMethods' and 'LenientMethods'"
core_server_config *conf = ap_get_core_module_config(r->server->module_config);
int strict = (conf->http_conformance != AP_HTTP_CONFORMANCE_UNSAFE);
int stricturi = (conf->http_stricturi != AP_HTTP_URI_UNSAFE);
- int strictspaces = (conf->http_whitespace != AP_HTTP_WHITESPACE_UNSAFE);
/* Read past empty lines until we get a real request line,
* a read error, the connection closes (EOF), or we timeout.
}
/* Verify method terminated with a single SP, otherwise mark in error */
- if (strictspaces && ll[0] && (ll[0] != ' ' || apr_isspace(ll[1]))
+ if (strict && ll[0] && (ll[0] != ' ' || apr_isspace(ll[1]))
&& deferred_error == rrl_none) {
deferred_error = rrl_excesswhitespace;
}
* then NUL terminate the method string
*/
for (uri = ll; apr_isspace(*uri); ++uri)
- if (strictspaces && ap_strchr_c("\t\n\v\f\r", *uri)
+ if (strict && ap_strchr_c("\t\n\v\f\r", *uri)
&& deferred_error == rrl_none)
deferred_error = rrl_badwhitespace;
*ll = '\0';
}
/* Verify uri terminated with a single SP, otherwise mark in error */
- if (strictspaces && ll[0] && (ll[0] != ' ' || apr_isspace(ll[1]))
+ if (strict && ll[0] && (ll[0] != ' ' || apr_isspace(ll[1]))
&& deferred_error == rrl_none) {
deferred_error = rrl_excesswhitespace;
}
* then NUL terminate the uri string
*/
for (r->protocol = ll; apr_isspace(*r->protocol); ++r->protocol)
- if (strictspaces && ap_strchr_c("\t\n\v\f\r", *r->protocol)
+ if (strict && ap_strchr_c("\t\n\v\f\r", *r->protocol)
&& deferred_error == rrl_none)
deferred_error = rrl_badwhitespace;
*ll = '\0';
* determine if trailing text is found, unconditionally mark in error,
* finally NUL terminate the protocol string
*/
- if (strictspaces && *ll)
+ if (strict && *ll)
deferred_error = rrl_excesswhitespace;
for ( ; apr_isspace(*ll); ++ll)
- if (strictspaces && ap_strchr_c("\t\n\v\f\r", *ll)
+ if (strict && ap_strchr_c("\t\n\v\f\r", *ll)
&& deferred_error == rrl_none)
deferred_error = rrl_badwhitespace;
if (*ll && deferred_error == rrl_none)
char *tmp_field;
core_server_config *conf = ap_get_core_module_config(r->server->module_config);
int strict = (conf->http_conformance != AP_HTTP_CONFORMANCE_UNSAFE);
- int strictspaces = (conf->http_whitespace != AP_HTTP_WHITESPACE_UNSAFE);
/*
* Read header lines until we get the empty separator line, a read error,
return;
}
- if (strictspaces && strpbrk(field, "\n\v\f\r")) {
+ if (strict && strpbrk(field, "\n\v\f\r")) {
r->status = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03451)
"Request header line presented bad whitespace "
*value++ = '\0'; /* NUL-terminate at colon */
- if (strictspaces && strpbrk(last_field, " \t")) {
+ if (strict && strpbrk(last_field, " \t")) {
r->status = HTTP_BAD_REQUEST;
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03452)
"Request header field name with whitespace "