diff options
author | Stefan Eissing <icing@apache.org> | 2023-02-16 11:21:23 +0100 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2023-02-16 11:21:23 +0100 |
commit | 46fff96dd2b8163c27a6003beb1e0d57a367cbca (patch) | |
tree | 404455c002ca28e1c816aa25252ed5f42b1c721c | |
parent | Fix signedness formatting check in mod_dav code. (diff) | |
download | apache2-46fff96dd2b8163c27a6003beb1e0d57a367cbca.tar.xz apache2-46fff96dd2b8163c27a6003beb1e0d57a367cbca.zip |
*) mod_http2: deny protocol upgrade if the request has a chunked-encoded body.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907696 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | modules/http2/h2_switch.c | 5 | ||||
-rw-r--r-- | modules/http2/h2_version.h | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/modules/http2/h2_switch.c b/modules/http2/h2_switch.c index a30f27ce9d..3799701723 100644 --- a/modules/http2/h2_switch.c +++ b/modules/http2/h2_switch.c @@ -104,9 +104,10 @@ static int h2_protocol_propose(conn_rec *c, request_rec *r, /* We also allow switching only for requests that have no body. */ p = apr_table_get(r->headers_in, "Content-Length"); - if (p && strcmp(p, "0")) { + if ((p && strcmp(p, "0")) + || (!p && apr_table_get(r->headers_in, "Transfer-Encoding"))) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(03087) - "upgrade with content-length: %s, declined", p); + "upgrade with body declined"); return DECLINED; } } diff --git a/modules/http2/h2_version.h b/modules/http2/h2_version.h index c961089901..0caa800387 100644 --- a/modules/http2/h2_version.h +++ b/modules/http2/h2_version.h @@ -27,7 +27,7 @@ * @macro * Version number of the http2 module as c string */ -#define MOD_HTTP2_VERSION "2.0.11" +#define MOD_HTTP2_VERSION "2.0.12" /** * @macro @@ -35,7 +35,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 0x02000b +#define MOD_HTTP2_VERSION_NUM 0x02000c #endif /* mod_h2_h2_version_h */ |