httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r581359 - /httpd/httpd/trunk/modules/http/http_core.c
Date Tue, 02 Oct 2007 19:29:36 GMT
Author: jim
Date: Tue Oct  2 12:29:36 2007
New Revision: 581359

URL: http://svn.apache.org/viewvc?rev=581359&view=rev
Log:

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.


Modified:
    httpd/httpd/trunk/modules/http/http_core.c

Modified: httpd/httpd/trunk/modules/http/http_core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_core.c?rev=581359&r1=581358&r2=581359&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_core.c (original)
+++ httpd/httpd/trunk/modules/http/http_core.c Tue Oct  2 12:29:36 2007
@@ -234,6 +234,24 @@
     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 @@
     }
 
     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);



Mime
View raw message