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
3e8874ed
Commit
3e8874ed
authored
Jan 14, 2015
by
Federico G. Schwindt
Committed by
Lasse Karstensen
Jan 14, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Collapse multiple X-Forwarded-For headers
Fixes #1650
parent
2f5d19f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
cache_req_fsm.c
bin/varnishd/cache/cache_req_fsm.c
+1
-0
r01650.vtc
bin/varnishtest/tests/r01650.vtc
+16
-0
No files found.
bin/varnishd/cache/cache_req_fsm.c
View file @
3e8874ed
...
...
@@ -724,6 +724,7 @@ cnt_recv(struct worker *wrk, struct req *req)
* This really should be done earlier, but we want to capture
* it in the VSL log.
*/
http_CollectHdr
(
req
->
http
,
H_X_Forwarded_For
);
if
(
http_GetHdr
(
req
->
http
,
H_X_Forwarded_For
,
&
xff
))
{
http_Unset
(
req
->
http
,
H_X_Forwarded_For
);
http_PrintfHeader
(
req
->
http
,
"X-Forwarded-For: %s, %s"
,
...
...
bin/varnishtest/tests/r01650.vtc
0 → 100644
View file @
3e8874ed
varnishtest "xff handling discards multiple headers"
server s1 {
rxreq
expect req.http.X-Forwarded-For == "1.2.3.4, 5.6.7.8, 127.0.0.1"
txresp
} -start
varnish v1 -vcl+backend {
} -start
client c1 {
txreq -hdr "X-Forwarded-For: 1.2.3.4" -hdr "X-Forwarded-For: 5.6.7.8"
rxresp
} -run
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