mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Fix another oversight: don't add an extension method to the Allow
list if it's already there. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86049 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1462,10 +1462,22 @@ API_EXPORT(void) ap_allow_methods(request_rec *r, int reset, ...) {
|
|||||||
* additional check of this array if it *is* invalid.
|
* additional check of this array if it *is* invalid.
|
||||||
*/
|
*/
|
||||||
if (mnum == M_INVALID) {
|
if (mnum == M_INVALID) {
|
||||||
|
int i;
|
||||||
|
char **xmethods;
|
||||||
|
|
||||||
if (r->allowed_xmethods == NULL) {
|
if (r->allowed_xmethods == NULL) {
|
||||||
r->allowed_xmethods = apr_make_array(r->pool, 2,
|
r->allowed_xmethods = apr_make_array(r->pool, 2,
|
||||||
sizeof(char *));
|
sizeof(char *));
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Don't add it to the array if it's already listed.
|
||||||
|
*/
|
||||||
|
xmethods = (char **) r->allowed_xmethods->elts;
|
||||||
|
for (i = 0; i < r->allowed_xmethods->nelts; ++i) {
|
||||||
|
if (strcmp(method, xmethods[i]) == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
xmethod = (const char **) apr_push_array(r->allowed_xmethods);
|
xmethod = (const char **) apr_push_array(r->allowed_xmethods);
|
||||||
*xmethod = method;
|
*xmethod = method;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user