]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mod_http2: deny protocol upgrade if the request has a chunked-encoded body.
authorStefan Eissing <icing@apache.org>
Thu, 16 Feb 2023 10:21:23 +0000 (10:21 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 16 Feb 2023 10:21:23 +0000 (10:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1907696 13f79535-47bb-0310-9956-ffa450edef68

modules/http2/h2_switch.c
modules/http2/h2_version.h

index a30f27ce9d965e7b8fd282165c3bded3bde03286..3799701723c99921a4f510747f76f8002b14d9df 100644 (file)
@@ -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;
         }
     }
index c9610899015e56879e8990d1c132d1c61dda0fb0..0caa8003873eec4af804bf40d3e0c9dae2f55463 100644 (file)
@@ -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 */