mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Don't skip any remaining methods just because one was already
noted. Submitted by: Joe Orton <joe@orton.demon.co.uk> Reviewed by: Ken Coar git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86050 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1463,6 +1463,7 @@ API_EXPORT(void) ap_allow_methods(request_rec *r, int reset, ...) {
|
||||
*/
|
||||
if (mnum == M_INVALID) {
|
||||
int i;
|
||||
int found;
|
||||
char **xmethods;
|
||||
|
||||
if (r->allowed_xmethods == NULL) {
|
||||
@@ -1473,13 +1474,17 @@ API_EXPORT(void) ap_allow_methods(request_rec *r, int reset, ...) {
|
||||
* Don't add it to the array if it's already listed.
|
||||
*/
|
||||
xmethods = (char **) r->allowed_xmethods->elts;
|
||||
found = 0;
|
||||
for (i = 0; i < r->allowed_xmethods->nelts; ++i) {
|
||||
if (strcmp(method, xmethods[i]) == 0) {
|
||||
return;
|
||||
found++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
xmethod = (const char **) apr_push_array(r->allowed_xmethods);
|
||||
*xmethod = method;
|
||||
if (!found) {
|
||||
xmethod = (const char **) apr_push_array(r->allowed_xmethods);
|
||||
*xmethod = method;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user