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

Function header_cmd

modules/metadata/mod_headers.c:558–588  ·  view source on GitHub ↗

Handle all (xxx)Header directives */

Source from the content-addressed store, hash-verified

556
557/* Handle all (xxx)Header directives */
558static const char *header_cmd(cmd_parms *cmd, void *indirconf,
559 const char *args)
560{
561 const char *action;
562 const char *hdr;
563 const char *val;
564 const char *envclause;
565 const char *subs;
566
567 action = ap_getword_conf(cmd->temp_pool, &args);
568 if (cmd->info == &hdr_out_onsuccess) {
569 if (!strcasecmp(action, "always")) {
570 cmd->info = &hdr_out_always;
571 action = ap_getword_conf(cmd->temp_pool, &args);
572 }
573 else if (!strcasecmp(action, "onsuccess")) {
574 action = ap_getword_conf(cmd->temp_pool, &args);
575 }
576 }
577 hdr = ap_getword_conf(cmd->pool, &args);
578 val = *args ? ap_getword_conf(cmd->pool, &args) : NULL;
579 subs = *args ? ap_getword_conf(cmd->pool, &args) : NULL;
580 envclause = *args ? ap_getword_conf(cmd->pool, &args) : NULL;
581
582 if (*args) {
583 return apr_pstrcat(cmd->pool, cmd->cmd->name,
584 " has too many arguments", NULL);
585 }
586
587 return header_inout_cmd(cmd, indirconf, action, hdr, val, subs, envclause);
588}
589
590/*
591 * Process the tags in the format string. Tags may be format specifiers

Callers

nothing calls this directly

Calls 2

ap_getword_confFunction · 0.85
header_inout_cmdFunction · 0.85

Tested by

no test coverage detected