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

Function add_alias

modules/mappers/mod_alias.c:201–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201static const char *add_alias(cmd_parms *cmd, void *dummy, const char *fake,
202 const char *real)
203{
204 if (real) {
205
206 return add_alias_internal(cmd, dummy, fake, real, 0);
207
208 }
209 else {
210 alias_dir_conf *dirconf = (alias_dir_conf *) dummy;
211
212 const char *err = ap_check_cmd_context(cmd, NOT_IN_DIRECTORY|NOT_IN_FILES);
213
214 if (err != NULL) {
215 return err;
216 }
217
218 if (!cmd->path) {
219 return "Alias must have two arguments when used globally";
220 }
221
222 dirconf->alias =
223 ap_expr_parse_cmd(cmd, fake, AP_EXPR_FLAG_STRING_RESULT,
224 &err, NULL);
225 if (err) {
226 return apr_pstrcat(cmd->temp_pool,
227 "Cannot parse alias expression '", fake, "': ", err,
228 NULL);
229 }
230
231 dirconf->alias_fake = cmd->path;
232 dirconf->handler = cmd->info;
233 dirconf->alias_set = 1;
234
235 return NULL;
236
237 }
238}
239
240static const char *add_alias_regex(cmd_parms *cmd, void *dummy,
241 const char *fake, const char *real)

Callers

nothing calls this directly

Calls 2

add_alias_internalFunction · 0.85
ap_check_cmd_contextFunction · 0.85

Tested by

no test coverage detected