From 67018923c830b1c697cd64b4fbde0ef4c2ae678f Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Fri, 5 May 2017 13:23:48 +0000 Subject: [PATCH] On the 2.4.x branch: Merged /httpd/httpd/trunk:r1793533,1794049 mod_http2: fail requests without ERROR log in case we need to read interim responses and see only garbage. This can happen if proxied servers send data where none should be, e.g. a body for a HEAD request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1794052 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/http2/h2_from_h1.c | 9 ++++++++- modules/http2/h2_version.h | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ef22625990..6a03c3e2cc 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.4.26 + *) mod_http2: fail requests without ERROR log in case we need to read interim + responses and see only garbage. This can happen if proxied servers send + data where none should be, e.g. a body for a HEAD request. [Stefan Eissing] + *) mod_proxy_http2: adding support for Reverse Proxy Request headers. [Stefan Eissing] diff --git a/modules/http2/h2_from_h1.c b/modules/http2/h2_from_h1.c index a8f50987f3..56f051ef8c 100644 --- a/modules/http2/h2_from_h1.c +++ b/modules/http2/h2_from_h1.c @@ -449,7 +449,14 @@ static apr_status_t parse_status(h2_task *task, char *line) return APR_SUCCESS; } - ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, task->c, APLOGNO(03467) + /* Seems like there is garbage on the connection. May be a leftover + * from a previous proxy request. + * This should only happen if the H2_RESPONSE filter is not yet in + * place (post_read_request has not been reached and the handler wants + * to write something. Probably just the interim response we are + * waiting for. But if there is other data hanging around before + * that, this needs to fail. */ + ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, task->c, APLOGNO(03467) "h2_task(%s): unable to parse status line: %s", task->id, line); return APR_EINVAL; diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index 4f85b04382..70608f3fa6 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -26,7 +26,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "1.10.4" +#define MOD_HTTP2_VERSION "1.10.5" /** * @macro @@ -34,7 +34,7 @@ * release. This is a 24 bit number with 8 bits for major number, 8 bits * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203. */ -#define MOD_HTTP2_VERSION_NUM 0x010a04 +#define MOD_HTTP2_VERSION_NUM 0x010a05 #endif /* mod_h2_h2_version_h */ -- 2.40.0