BBlack has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/339648 )

Change subject: VCL: do not allow empty url when un-proxying
......................................................................


VCL: do not allow empty url when un-proxying

This code allowed for the possibility that an incoming request
could look like "GET https://foo.com HTTP/1.1", and we'd convert
that to req.http.Host = "foo.com" and req.url = "".  This change
ensures req.url would be "/" in such a case.

Change-Id: If0c02e070f0e2803d0fff977dfe3224d232f1d4f
---
M modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  BBlack: Verified; Looks good to me, approved



diff --git a/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb 
b/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb
index 0483a6c..c29df89 100644
--- a/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb
+++ b/modules/varnish/templates/vcl/wikimedia-frontend.vcl.erb
@@ -62,7 +62,7 @@
        if(req.url ~ "(?i)^https?://[^/]") {
                # this strips away 'user:pass@' and ':port' when copying from 
URI to Host:
                set req.http.Host = regsub(req.url, 
"(?i)^https?://(.*@)?([^/:]+).*$", "\2");
-               set req.url = regsub(req.url, "(?i)^https?://[^/]+", "");
+               set req.url = regsub(req.url, "(?i)^https?://[^/]+/?", "/");
        }
 
        // Strip :port from req.http.host and normalize to lowercase

-- 
To view, visit https://gerrit.wikimedia.org/r/339648
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If0c02e070f0e2803d0fff977dfe3224d232f1d4f
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Ema <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to