BBlack has submitted this change and it was merged.

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(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I2be036d597c08986c7cff399be291d1c0b97a2e3
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yurik <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Dfoy <[email protected]>
Gerrit-Reviewer: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: Mark Bergsma <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to