Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
58b2d306
Commit
58b2d306
authored
Mar 30, 2017
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grow a separator argument in std.collect
Fixes #2292
parent
d26a8287
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
vmod.vcc
lib/libvmod_std/vmod.vcc
+7
-5
vmod_std.c
lib/libvmod_std/vmod_std.c
+3
-3
No files found.
lib/libvmod_std/vmod.vcc
View file @
58b2d306
#-
# Copyright (c) 2010-201
5
Varnish Software AS
# Copyright (c) 2010-201
7
Varnish Software AS
# All rights reserved.
#
# Author: Poul-Henning Kamp <phk@FreeBSD.org>
...
...
@@ -107,17 +107,19 @@ Description
Example
set beresp.http.served-by = std.fileread("/etc/hostname");
$Function VOID collect(HEADER hdr)
$Function VOID collect(HEADER hdr
, STRING sep=","
)
Description
Collapses multiple *hdr* headers into one long header.
The header values are joined with a comma (",").
The header values are joined with a comma (",") unless a
different separator is specified.
Care should be taken when collapsing headers. In particular
collapsing Set-Cookie will lead to unexpected results on the
browser side.
Example
std.collect(req.http.cookie);
Examples
std.collect(req.http.accept);
std.collect(req.http.cookie, "; ");
$Function DURATION duration(STRING s, DURATION fallback)
...
...
lib/libvmod_std/vmod_std.c
View file @
58b2d306
/*-
* Copyright (c) 2010-201
5
Varnish Software AS
* Copyright (c) 2010-201
7
Varnish Software AS
* All rights reserved.
*
* Author: Poul-Henning Kamp <phk@FreeBSD.org>
...
...
@@ -174,13 +174,13 @@ vmod_syslog(VRT_CTX, VCL_INT fac, const char *fmt, ...)
}
VCL_VOID
__match_proto__
(
td_std_collect
)
vmod_collect
(
VRT_CTX
,
VCL_HEADER
hdr
)
vmod_collect
(
VRT_CTX
,
VCL_HEADER
hdr
,
VCL_STRING
sep
)
{
struct
http
*
hp
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
hp
=
VRT_selecthttp
(
ctx
,
hdr
->
where
);
http_CollectHdr
(
hp
,
hdr
->
what
);
http_CollectHdr
Sep
(
hp
,
hdr
->
what
,
sep
);
}
VCL_BOOL
__match_proto__
(
td_std_healthy
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment