by a *fchild* stanza. This action exists mostly for
convenience.
-A *match* stanza may also contain any number of *set* lines, as
-follows:
+A *match* stanza may also contain any number of the following,
+optional directives:
*set* 'HEADER' 'VALUE'::
named HTTP 'HEADER' in the request is set to 'VALUE' before
passing the request on to the specified handler.
+*xset* 'HEADER' 'VALUE'::
+
+ *xset* does exactly the same thing as *set*, except the
+ 'HEADER' is automatically prepended with the `X-Ash-`
+ prefix. The intention is only to make configuration files
+ look nicer in this very common case.
+
404 RESPONSES
-------------
request on to the specified handler. A *match* stanza may
contain any number of *set* lines.
+*xset* 'HEADER' 'VALUE'::
+
+ *xset* does exactly the same thing as *set*, except the
+ 'HEADER' is automatically prepended with the `X-Ash-`
+ prefix. The intention is only to make configuration files
+ look nicer in this very common case.
+
*restpat* 'TEMPLATE'::
If the *match* stanza as a whole matches, 'TEMPLATE' is
pat->childnm = sstrdup(s->argv[1]);
} else if(!strcmp(s->argv[0], "fork")) {
pat->fchild = cadup(s->argv + 1);
- } else if(!strcmp(s->argv[0], "set")) {
+ } else if(!strcmp(s->argv[0], "set") || !strcmp(s->argv[0], "xset")) {
if(s->argc < 3) {
- flog(LOG_WARNING, "%s:%i: missing header name or pattern for `set' directive", s->file, s->lno);
+ flog(LOG_WARNING, "%s:%i: missing header name or pattern for `%s' directive", s->file, s->lno, s->argv[0]);
continue;
}
omalloc(head);
- head->name = sstrdup(s->argv[1]);
+ if(!strcmp(s->argv[0], "xset"))
+ head->name = sprintf2("X-Ash-%s", s->argv[1]);
+ else
+ head->name = sstrdup(s->argv[1]);
head->value = sstrdup(s->argv[2]);
head->next = pat->headers;
pat->headers = head;
if(pat->restpat != NULL)
free(pat->restpat);
pat->restpat = sstrdup(s->argv[1]);
- } else if(!strcmp(s->argv[0], "set")) {
+ } else if(!strcmp(s->argv[0], "set") || !strcmp(s->argv[0], "xset")) {
if(s->argc < 3) {
- flog(LOG_WARNING, "%s:%i: missing header name or pattern for `set' directive", s->file, s->lno);
+ flog(LOG_WARNING, "%s:%i: missing header name or pattern for `%s' directive", s->file, s->lno, s->argv[0]);
continue;
}
omalloc(head);
- head->name = sstrdup(s->argv[1]);
+ if(!strcmp(s->argv[0], "xset"))
+ head->name = sprintf2("X-Ash-%s", s->argv[1]);
+ else
+ head->name = sstrdup(s->argv[1]);
head->value = sstrdup(s->argv[2]);
head->next = pat->headers;
pat->headers = head;