From: Jim Jagielski Date: Tue, 2 Oct 2007 19:29:36 +0000 (+0000) Subject: OPTIONS * does not map to storage, so handle this X-Git-Tag: 2.3.0~1363 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5773c94270830227b0ba1fd89422b5c32812cbe7;p=apache OPTIONS * does not map to storage, so handle this as appropriate. For other Request URIs, we drop down the the default_handler to do that for us. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@581359 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_core.c b/modules/http/http_core.c index 6206c38d3b..687dc06efe 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -234,6 +234,24 @@ static int http_create_request(request_rec *r) return OK; } +static int http_send_options(request_rec *r) +{ + int rv; + if ((r->method_number != M_OPTIONS) || !r->uri || strcmp(r->uri, "*")) { + return DECLINED; + } + + ap_allow_standard_methods(r, MERGE_ALLOW, M_GET, M_OPTIONS, M_POST, -1); + rv = ap_send_http_options(r); + + if (rv == OK) { + rv = DONE; + } + + return rv; +} + + static void register_hooks(apr_pool_t *p) { /** @@ -252,6 +270,7 @@ static void register_hooks(apr_pool_t *p) } ap_hook_map_to_storage(ap_send_http_trace,NULL,NULL,APR_HOOK_MIDDLE); + ap_hook_map_to_storage(http_send_options,NULL,NULL,APR_HOOK_MIDDLE); ap_hook_http_scheme(http_scheme,NULL,NULL,APR_HOOK_REALLY_LAST); ap_hook_default_port(http_port,NULL,NULL,APR_HOOK_REALLY_LAST); ap_hook_create_request(http_create_request, NULL, NULL, APR_HOOK_REALLY_LAST);