From 62989065feb42cb8a89933c6777cdd3783b96bec Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Fri, 11 Aug 2000 16:31:02 +0000 Subject: [PATCH] Don't skip any remaining methods just because one was already noted. Submitted by: Joe Orton Reviewed by: Ken Coar git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86050 13f79535-47bb-0310-9956-ffa450edef68 --- modules/http/http_request.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/http/http_request.c b/modules/http/http_request.c index 6158fb5a08..1767bea515 100644 --- a/modules/http/http_request.c +++ b/modules/http/http_request.c @@ -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; + } } } }