ASF Bugzilla – Attachment 4116 Details for
Bug 15242
mod_cgi prevents handling of OPTIONS request
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to configure whether userland CGI could handle OPTIONS request.
mod_cgi.c.patch (text/plain), 2.38 KB, created by
Taisuke Yamada
on 2002-12-10 16:50:08 UTC
(
hide
)
Description:
Patch to configure whether userland CGI could handle OPTIONS request.
Filename:
MIME Type:
Creator:
Taisuke Yamada
Created:
2002-12-10 16:50:08 UTC
Size:
2.38 KB
patch
obsolete
>--- apache-1.3/src/modules/standard/mod_cgi.c.orig 2002-12-11 01:35:05.000000000 +0900 >+++ apache-1.3/src/modules/standard/mod_cgi.c 2002-12-11 01:34:29.000000000 +0900 >@@ -98,12 +98,37 @@ > #define DEFAULT_LOGBYTES 10385760 > #define DEFAULT_BUFBYTES 1024 > >+enum { FLAG_UNSET, FLAG_ON, FLAG_OFF }; >+ > typedef struct { > char *logname; > long logbytes; > int bufbytes; > } cgi_server_conf; > >+typedef struct { >+ int trapoptions; >+} cgi_dir_conf; >+ >+static void *create_cgi_dconfig(pool *p, char *d) >+{ >+ cgi_dir_conf *c = (cgi_dir_conf *) ap_pcalloc(p, sizeof(cgi_dir_conf)); >+ >+ c->trapoptions = FLAG_UNSET; >+ >+ return c; >+} >+ >+static void *merge_cgi_dconfig(pool *p, void *basev, void *overridesv) >+{ >+ cgi_dir_conf *base = (cgi_dir_conf *) basev, *overrides = (cgi_dir_conf *) overridesv; >+ >+ if (overrides->trapoptions == FLAG_UNSET) { >+ overrides->trapoptions = base->trapoptions; >+ } >+ return overrides; >+} >+ > static void *create_cgi_config(pool *p, server_rec *s) > { > cgi_server_conf *c = >@@ -161,6 +186,9 @@ > "the maximum length (in bytes) of the script debug log"}, > {"ScriptLogBuffer", set_scriptlog_buffer, NULL, RSRC_CONF, TAKE1, > "the maximum size (in bytes) to record of a POST request"}, >+ {"ScriptTrapOptions", ap_set_flag_slot, >+ (void *)XtOffsetOf(cgi_dir_conf, trapoptions), OR_ALL, FLAG, >+ "the flag to specify whether CGI handles OPTIONS request or not"}, > {NULL} > }; > >@@ -377,10 +405,12 @@ > void *sconf = r->server->module_config; > cgi_server_conf *conf = > (cgi_server_conf *) ap_get_module_config(sconf, &cgi_module); >+ cgi_dir_conf *dconf = >+ (cgi_dir_conf *) ap_get_module_config(r->per_dir_config, &cgi_module); > > struct cgi_child_stuff cld; > >- if (r->method_number == M_OPTIONS) { >+ if (dconf->trapoptions != FLAG_OFF && r->method_number == M_OPTIONS) { > /* 99 out of 100 CGI scripts, this is all they support */ > r->allowed |= (1 << M_GET); > r->allowed |= (1 << M_POST); >@@ -610,8 +640,8 @@ > { > STANDARD_MODULE_STUFF, > NULL, /* initializer */ >- NULL, /* dir config creater */ >- NULL, /* dir merger --- default is to override */ >+ create_cgi_dconfig, /* dir config creater */ >+ merge_cgi_dconfig, /* dir merger --- default is to override */ > create_cgi_config, /* server config */ > merge_cgi_config, /* merge server config */ > cgi_cmds, /* command table */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15242
: 4116 |
4117
|
11102