| 108 | } |
| 109 | |
| 110 | static const char *set_script(cmd_parms *cmd, void *m_v, |
| 111 | const char *method, const char *script) |
| 112 | { |
| 113 | action_dir_config *m = (action_dir_config *)m_v; |
| 114 | int methnum; |
| 115 | if (cmd->pool == cmd->temp_pool) { |
| 116 | /* In .htaccess, we can't globally register new methods. */ |
| 117 | methnum = ap_method_number_of(method); |
| 118 | } |
| 119 | else { |
| 120 | /* ap_method_register recognizes already registered methods, |
| 121 | * so don't bother to check its previous existence explicitly. |
| 122 | */ |
| 123 | methnum = ap_method_register(cmd->pool, method); |
| 124 | } |
| 125 | |
| 126 | if (methnum == M_TRACE) { |
| 127 | return "TRACE not allowed for Script"; |
| 128 | } |
| 129 | else if (methnum == M_INVALID) { |
| 130 | return apr_pstrcat(cmd->pool, "Could not register method '", method, |
| 131 | "' for Script", NULL); |
| 132 | } |
| 133 | |
| 134 | m->scripted[methnum] = script; |
| 135 | m->configured = 1; |
| 136 | |
| 137 | return NULL; |
| 138 | } |
| 139 | |
| 140 | static const command_rec action_cmds[] = |
| 141 | { |
nothing calls this directly
no test coverage detected