]> granicus.if.org Git - apache/commitdiff
OPTIONS * does not map to storage, so handle this
authorJim Jagielski <jim@apache.org>
Tue, 2 Oct 2007 19:29:36 +0000 (19:29 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 2 Oct 2007 19:29:36 +0000 (19:29 +0000)
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

modules/http/http_core.c

index 6206c38d3b3d5746a58b51f4968f454334a69b97..687dc06efebb665c807ac875d1ff8e2744ca42e9 100644 (file)
@@ -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);