[arvados] updated: 2.1.0-2619-g11f4d90ff
git repository hosting
git at public.arvados.org
Tue Jun 28 19:41:26 UTC 2022
Summary of changes:
lib/service/cmd.go | 6 +++++-
lib/service/cmd_test.go | 6 ++++--
2 files changed, 9 insertions(+), 3 deletions(-)
via 11f4d90ff07de3557a86d78cb8623ad059633d04 (commit)
from 2df5de69d74ab1fbf1fbcec23d392193522b0364 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 11f4d90ff07de3557a86d78cb8623ad059633d04
Author: Tom Clegg <tom at curii.com>
Date: Tue Jun 28 15:40:26 2022 -0400
16561: Handle implicit port number in ws:// and wss:// urls.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/service/cmd.go b/lib/service/cmd.go
index 9e45e0f7e..04c3e170e 100644
--- a/lib/service/cmd.go
+++ b/lib/service/cmd.go
@@ -279,7 +279,11 @@ func getListenAddr(svcs arvados.Services, prog arvados.ServiceName, log logrus.F
// explicit port name/number) means listen on
// the well-known port for the specified
// protocol, "foo.example:https".
- listenAddr = net.JoinHostPort(listenAddr, listenURL.Scheme)
+ port := listenURL.Scheme
+ if port == "ws" || port == "wss" {
+ port = "http" + port[2:]
+ }
+ listenAddr = net.JoinHostPort(listenAddr, port)
}
listener, err := net.Listen("tcp", listenAddr)
if err == nil {
diff --git a/lib/service/cmd_test.go b/lib/service/cmd_test.go
index 7a1f98a8f..7db910927 100644
--- a/lib/service/cmd_test.go
+++ b/lib/service/cmd_test.go
@@ -64,8 +64,6 @@ func (*Suite) TestGetListenAddress(c *check.C) {
},
{ // implicit port 80 in InternalURLs
internalURLs: map[string]string{"http://localhost/": ""},
- expectListen: "http://localhost/",
- expectInternal: "http://localhost/",
expectErrorMatch: `.*:80: bind: permission denied`,
},
{ // implicit port 443 in InternalURLs
@@ -73,6 +71,10 @@ func (*Suite) TestGetListenAddress(c *check.C) {
expectListen: "http://localhost:" + unusedPort + "/",
expectInternal: "https://host.example/",
},
+ { // implicit port 443 in ListenURL
+ internalURLs: map[string]string{"wss://host.example/": "wss://localhost/"},
+ expectErrorMatch: `.*:443: bind: permission denied`,
+ },
{
internalURLs: map[string]string{"https://hostname.example/": "http://localhost:8000/"},
expectListen: "http://localhost:8000/",
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list