MCPcopy Create free account
hub / github.com/apache/httpd / am_allowmethods

Function am_allowmethods

modules/aaa/mod_allowmethods.c:106–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106static const char *am_allowmethods(cmd_parms *cmd, void *d, int argc,
107 char *const argv[])
108{
109 int i;
110 am_conf_t *conf = (am_conf_t *)d;
111
112 if (argc == 0) {
113 return "AllowMethods: No method or 'reset' keyword given";
114 }
115 if (argc == 1) {
116 if (strcasecmp("reset", argv[0]) == 0) {
117 conf->allowed = 0;
118 conf->allowed_set = 1;
119 return NULL;
120 }
121 }
122
123 for (i = 0; i < argc; i++) {
124 int m;
125
126 m = ap_method_number_of(argv[i]);
127 if (m == M_INVALID) {
128 return apr_pstrcat(cmd->pool, "AllowMethods: Invalid Method '",
129 argv[i], "'", NULL);
130 }
131
132 conf->allowed |= (AP_METHOD_BIT << m);
133 }
134 conf->allowed_set = 1;
135 return NULL;
136}
137
138static void am_register_hooks(apr_pool_t * p)
139{

Callers

nothing calls this directly

Calls 1

ap_method_number_ofFunction · 0.85

Tested by

no test coverage detected