From 99ab47d8efc160140c95db9e4c2d12934dca6200 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 25 Jun 2017 06:09:43 +0000 Subject: [PATCH] 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 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799784 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_protocol.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index 29cc8d697c..dfe545d31b 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -871,11 +871,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; } } -- 2.40.0