Yurik has uploaded a new change for review.
https://gerrit.wikimedia.org/r/91813
Change subject: Fixed incorrect check against empty string in Varnish
......................................................................
Fixed incorrect check against empty string in Varnish
after regsub, X-Stripped-XFF will have an empty string,
which is not the same as "if (X-Stripped-XFF)" which only
checks for non-existing header
Change-Id: I2be036d597c08986c7cff399be291d1c0b97a2e3
---
M templates/varnish/zero.inc.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/13/91813/1
diff --git a/templates/varnish/zero.inc.vcl.erb
b/templates/varnish/zero.inc.vcl.erb
index 8eaa319..26c4253 100644
--- a/templates/varnish/zero.inc.vcl.erb
+++ b/templates/varnish/zero.inc.vcl.erb
@@ -24,7 +24,7 @@
set req.http.X-Stripped-XFF = regsub(req.http.X-Forwarded-For,
",?[^,]+$", "");
// ^ X-S-XFF now contains XFF without its final item, which was
client.ip.
- if (req.http.X-Stripped-XFF) { // If one or more IPs remain in
X-S-XFF
+ if (req.http.X-Stripped-XFF != "") { // If one or more IPs
remain in X-S-XFF
// Strip away any leading IPs, such that the result of
regsub() is the
// rightmost (or only) remaining IP, and use that to
re-set X-CS2:
set req.http.X-CS2 = netmapper.map("zero",
regsub(req.http.X-Stripped-XFF, "^.*, ?", ""));
--
To view, visit https://gerrit.wikimedia.org/r/91813
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2be036d597c08986c7cff399be291d1c0b97a2e3
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yurik <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits