Commit 2e2cc348 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Merge branch 'sh-workhorse-allow-https-backend' into 'master'

Workhorse: Allow HTTPS for backends

See merge request gitlab-org/gitlab!81061
parents abee2995 24fbcde5
......@@ -18,8 +18,8 @@ func parseAuthBackend(authBackend string) (*url.URL, error) {
}
}
if backendURL.Scheme != "http" {
return nil, fmt.Errorf("invalid scheme, only 'http' is allowed: %q", authBackend)
if backendURL.Scheme != "http" && backendURL.Scheme != "https" {
return nil, fmt.Errorf("invalid scheme, only 'http' and 'https' are allowed: %q", authBackend)
}
if backendURL.Host == "" {
......
......@@ -10,7 +10,7 @@ func TestParseAuthBackendFailure(t *testing.T) {
failures := []string{
"",
"ftp://localhost",
"https://example.com",
"gopher://example.com",
}
for _, example := range failures {
......@@ -27,6 +27,7 @@ func TestParseAuthBackend(t *testing.T) {
{"localhost:3000", "localhost:3000", "http"},
{"http://localhost", "localhost", "http"},
{"localhost", "localhost", "http"},
{"https://localhost", "localhost", "https"},
}
for _, example := range successes {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment