You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2017/06/25 06:09:43 UTC
svn commit: r1799784 - /httpd/httpd/trunk/modules/http/http_protocol.c
Author: jailletc36
Date: Sun Jun 25 06:09:43 2017
New Revision: 1799784
URL: http://svn.apache.org/viewvc?rev=1799784&view=rev
Log:
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
Modified:
httpd/httpd/trunk/modules/http/http_protocol.c
Modified: httpd/httpd/trunk/modules/http/http_protocol.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_protocol.c?rev=1799784&r1=1799783&r2=1799784&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_protocol.c (original)
+++ httpd/httpd/trunk/modules/http/http_protocol.c Sun Jun 25 06:09:43 2017
@@ -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;
}
}