]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_html: fix metafix handling of <meta http-equiv> elements
authorNick Kew <niq@apache.org>
Sat, 16 Dec 2017 22:05:01 +0000 (22:05 +0000)
committerNick Kew <niq@apache.org>
Sat, 16 Dec 2017 22:05:01 +0000 (22:05 +0000)
PR#58121

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1818457 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_proxy_html.c

diff --git a/CHANGES b/CHANGES
index af35966b7df11bb33b5334643aacb727d87f23e8..4bccfd0149b23ebe859ea2c44783760150bc8c61 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_proxy_html: fix handling of <meta http-equiv> elements.
+     PR 58121.  [Nick Kew]
+
   *) mod_md: fixed backward compatibility to old <ManagedDomain configuration.
      Add higher level WARNING log when initial request to ACME server fails, mentioning
      some advice. [Stefan Eissing] 
index fc28b278d95bdbed1497114f57f3bf48c96aa85e..ffa70c366ecbed8141276f94815fb0520e935b2c 100644 (file)
@@ -684,7 +684,12 @@ static meta *metafix(request_rec *r, const char *buf)
         while (!apr_isalpha(*++p));
         for (q = p; apr_isalnum(*q) || (*q == '-'); ++q);
         header = apr_pstrndup(r->pool, p, q-p);
-        if (ap_cstr_casecmpn(header, "Content-", 8)) {
+        if (!ap_cstr_casecmpn(header, "Content-Type", 12)) {
+            ret = apr_palloc(r->pool, sizeof(meta));
+            ret->start = offs+pmatch[0].rm_so;
+            ret->end = offs+pmatch[0].rm_eo;
+        }
+        else {
             /* find content=... string */
             p = apr_strmatch(seek_content, buf+offs+pmatch[0].rm_so,
                               pmatch[0].rm_eo - pmatch[0].rm_so);
@@ -712,11 +717,6 @@ static meta *metafix(request_rec *r, const char *buf)
                 }
             }
         }
-        else if (!ap_cstr_casecmpn(header, "Content-Type", 12)) {
-            ret = apr_palloc(r->pool, sizeof(meta));
-            ret->start = offs+pmatch[0].rm_so;
-            ret->end = offs+pmatch[0].rm_eo;
-        }
         if (header && content) {
 #ifndef GO_FASTER
             ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,