From d9a874765ce847e93223bc31e2efc9166312e11a Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 31 Jan 2023 09:28:21 +0100 Subject: HTTP + Util: Always set the scheme to HTTPS --- internal/oauth/oauth.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/oauth') diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go index 924b434..c11179c 100644 --- a/internal/oauth/oauth.go +++ b/internal/oauth/oauth.go @@ -490,7 +490,12 @@ func (oauth *OAuth) AuthURL(name string, postProcessAuth func(string) string) (s "redirect_uri": fmt.Sprintf("http://127.0.0.1:%d/callback", port), } - u, err := httpw.ConstructURL(oauth.BaseAuthorizationURL, params) + p, err := url.Parse(oauth.BaseAuthorizationURL) + if err != nil { + return "", errors.WrapPrefix(err, fmt.Sprintf("failed to parse OAuth base URL '%s'", oauth.BaseAuthorizationURL), 0) + } + + u, err := httpw.ConstructURL(p, params) if err != nil { return "", errors.WrapPrefix(err, "httpw.ConstructURL error", 0) } -- cgit v1.2.3