-*- coding: utf-8 -*-
Changes with Apache 2.5.1
- *) mod_proxy_http2: the "ping" proxy parameter
+
+ *) core: Have the HTTP 0.9 / 1.1 processing code reject requests for
+ HTTP >= 2.0 with a HTTP Version Not Support status code. [Ruediger Pluem]
+
+ *) mod_proxy_http2: the "ping" proxy parameter
(see <https://httpd.apache.org/docs/2.4/mod/mod_proxy.html>) is now used
when checking the liveliness of a new or reused h2 connection to the backend.
With short durations, this makes load-balancing more responsive. The module
enum {
rrl_none, rrl_badmethod, rrl_badwhitespace, rrl_excesswhitespace,
rrl_missinguri, rrl_baduri, rrl_badprotocol, rrl_trailingtext,
- rrl_badmethod09, rrl_reject09
+ rrl_badmethod09, rrl_reject09, rrl_versionnotsupported
} deferred_error = rrl_none;
apr_size_t len = 0;
char *uri, *ll;
r->proto_num = HTTP_VERSION(0, 9);
}
+ if (strict && deferred_error == rrl_none
+ && r->proto_num >= HTTP_VERSION(2, 0)) {
+ deferred_error = rrl_versionnotsupported;
+ }
+
/* Determine the method_number and parse the uri prior to invoking error
* handling, such that these fields are available for substitution
*/
* we can safely resume any deferred error reporting
*/
if (deferred_error != rrl_none) {
+ r->status = HTTP_BAD_REQUEST;
if (deferred_error == rrl_badmethod)
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03445)
"HTTP Request Line; Invalid method token: '%.*s'",
"HTTP Request Line; Unrecognized protocol '%.*s' "
"(perhaps whitespace was injected?)",
field_name_len(r->protocol), r->protocol);
- r->status = HTTP_BAD_REQUEST;
+ else if (deferred_error == rrl_versionnotsupported) {
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO()
+ "HTTP Request Line; Protocol '%.*s' >= HTTP/2.0 not"
+ " supported", field_name_len(r->protocol),
+ r->protocol);
+ r->status = HTTP_VERSION_NOT_SUPPORTED;
+ }
goto rrl_failed;
}