| 104 | } |
| 105 | |
| 106 | static 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 | |
| 138 | static void am_register_hooks(apr_pool_t * p) |
| 139 | { |
nothing calls this directly
no test coverage detected