]> granicus.if.org Git - apache/commitdiff
Merge r1799784, r1799786 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 26 Jun 2017 12:20:14 +0000 (12:20 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 26 Jun 2017 12:20:14 +0000 (12:20 +0000)
Since r1753257, "HEAD" method is registered into the registry hash with the M_GET ID.
(r1757672 in 2.4.x)

We iterate over all the values of the registery, so there is no need anymore to have a special case for "HEAD" in  'make_allow()'. It has its own entry now.

With the current code, we have "HEAD" 3 times in the Allow Header field.
This is because we find M_GET 2 times in the registry hash. The first one gives "GET" and "HEAD" (as the special handling), and the second "HEAD" and "HEAD" (as the special handling).

BTW, use APR_ARRAY_PUSH instead of hand coding it, in oder to have the code more readable.

PR 61207

Add  CHANGE entry
Submitted by: jailletc36
Reviewed by: jailletc36, rpluem, jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1799890 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index d655fd6bee9ee5a8f7d4f7322ab6c8319cf8364f..f647de2b4ce3177bd831aedc549a6417fe40657c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,11 @@
                                                          -*- coding: utf-8 -*-
 
+
 Changes with Apache 2.4.27
 
+  *) core: Avoid duplicate HEAD in Allow header.
+     This is a regression in 2.4.24 (unreleased), 2.4.25 and 2.4.26.
+     PR 61207. [Christophe Jaillet]
 
 Changes with Apache 2.4.26
 
diff --git a/STATUS b/STATUS
index 5ed367e4b14d236e318a8e372d78e06388b89851..1f75f6aaac758b0ae837451d5869ede0e38a09b0 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -116,12 +116,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   *) core: Avoid duplicate HEAD in Allow header. PR 61207.
-      trunk patch: http://svn.apache.org/r1799784
-                   http://svn.apache.org/r1799786 (CHANGES entry)
-      2.4.x patch: svn merge -c 1799784,1799786 ^/httpd/httpd/trunk .
-      +1: jailletc36, rpluem, jim
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 7c465777f27fff7d5e6ec714dccc49a8677ad199..8543fd19258c89a2dae14a546c49a4ec7a10e034 100644 (file)
@@ -1037,11 +1037,7 @@ static char *make_allow(request_rec *r)
 
         apr_hash_this(hi, &key, NULL, &val);
         if ((mask & (AP_METHOD_BIT << *(int *)val)) != 0) {
-            *(const char **)apr_array_push(allow) = key;
-
-            /* the M_GET method actually refers to two methods */
-            if (*(int *)val == M_GET)
-                *(const char **)apr_array_push(allow) = "HEAD";
+            APR_ARRAY_PUSH(allow, const char *) = key;
         }
     }