Yuvipanda has submitted this change and it was merged.

Change subject: tools: Allow origin protocols other than http
......................................................................


tools: Allow origin protocols other than http

Contains a backwards compatibility hack that adds http://
protocol if no protocol is found

Bug: T84983
Change-Id: If096d46e8d2db891e878cd0ebea2555d5a36605b
---
M modules/dynamicproxy/files/urlproxy.lua
M modules/toollabs/files/portgrabber
2 files changed, 8 insertions(+), 3 deletions(-)

Approvals:
  Yuvipanda: Looks good to me, approved
  coren: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/modules/dynamicproxy/files/urlproxy.lua 
b/modules/dynamicproxy/files/urlproxy.lua
index 0cb877a..78029af 100644
--- a/modules/dynamicproxy/files/urlproxy.lua
+++ b/modules/dynamicproxy/files/urlproxy.lua
@@ -33,7 +33,12 @@
     local routes = red:array_to_hash(routes_arr)
     for pattern, backend in pairs(routes) do
         if ngx.re.match(rest, pattern) ~= nil then
-            route = 'http://' .. backend
+            if string.match(backend, '://') then
+                route = backend
+            else
+                -- Temp hack since portgrabber did not
+                -- specify the http:// protocol by default
+                route = 'http://' . backend
             break
         end
     end
@@ -47,7 +52,7 @@
         local routes = red:array_to_hash(routes_arr)
         for pattern, backend in pairs(routes) do
             if ngx.re.match(rest, pattern) then
-                route = 'http://' .. backend
+                route = backend
                 break
             end
         end
diff --git a/modules/toollabs/files/portgrabber 
b/modules/toollabs/files/portgrabber
index 537472c..c2bf24b 100755
--- a/modules/toollabs/files/portgrabber
+++ b/modules/toollabs/files/portgrabber
@@ -31,7 +31,7 @@
 
 socket(PROXY, PF_INET, SOCK_STREAM, getprotobyname('tcp')) and
     connect(PROXY, sockaddr_in(8282, inet_aton('tools-webproxy'))) and
-    syswrite PROXY, ".*\n$host:$port\n";
+    syswrite PROXY, ".*\nhttp://$host:$port\n";;
 
 exec @ARGV, $port;
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If096d46e8d2db891e878cd0ebea2555d5a36605b
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yuvipanda <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: coren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to