.\" Man page generated from reStructuredText. . .TH VMOD_HEADER 3 "" "" "" .SH NAME vmod_header \- Header VMOD for Varnish . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .\" . .\" NB: This file is machine generated, DO NOT EDIT! . .\" . .\" Edit vmod.vcc and run make instead . .\" . .SH SYNOPSIS .sp import header [from "path"] ; .SH DESCRIPTION .sp Varnish Module (vmod) for manipulation of duplicated HTTP headers, for instance multiple Set\-Cookie headers. .SH CONTENTS .INDENT 0.0 .IP \(bu 2 \fIfunc_append\fP .IP \(bu 2 \fIfunc_copy\fP .IP \(bu 2 \fIfunc_get\fP .IP \(bu 2 \fIfunc_remove\fP .UNINDENT .SS append .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C VOID append(HEADER, STRING) .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Description Append an extra occurrence to an existing header. .TP .B Example .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C header.append(beresp.http.Set\-Cookie, "foo=bar") .ft P .fi .UNINDENT .UNINDENT .UNINDENT .SS copy .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C VOID copy(HEADER, HEADER) .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Description Copy all source headers to a new header. .TP .B Example .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C header.copy(beresp.http.set\-cookie, beresp.http.x\-old\-cookie); .ft P .fi .UNINDENT .UNINDENT .UNINDENT .SS get .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C STRING get(PRIV_CALL, HEADER header, STRING regex) .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Description Fetches the value of the first \fIheader\fP that matches the given regular expression \fIregex\fP\&. .TP .B Example .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C set beresp.http.xusr = header.get(beresp.http.set\-cookie,"user="); .ft P .fi .UNINDENT .UNINDENT .UNINDENT .SS remove .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C VOID remove(PRIV_CALL, HEADER header, STRING regex) .ft P .fi .UNINDENT .UNINDENT .INDENT 0.0 .TP .B Description Remove all occurences of \fIheader\fP that matches \fIregex\fP\&. .TP .B Example .INDENT 7.0 .INDENT 3.5 .sp .nf .ft C header.remove(beresp.http.set\-cookie,"^(?!(funcookie=))"); .ft P .fi .UNINDENT .UNINDENT .UNINDENT .SH ACKNOWLEDGEMENTS .sp The development of this plugin was made possible by the sponsorship of Softonic, \fI\%http://en.softonic.com/\fP . .sp Also thanks to Imo Klabun and Anders Nordby for bug reports. .SH BUGS .sp You can\(aqt use dynamic regular expressions, which also holds true for normal regular expressions in regsub(). .\" Generated by docutils manpage writer. .