diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-31 09:28:21 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-01-31 09:28:21 +0100 |
| commit | d9a874765ce847e93223bc31e2efc9166312e11a (patch) | |
| tree | 1e8b059fea12e0ace200fc2c8fe60ed88e42bdb0 /internal/oauth | |
| parent | b320b13b5d019c26928d2f00d8cba0febacb104b (diff) | |
HTTP + Util: Always set the scheme to HTTPS
Diffstat (limited to 'internal/oauth')
| -rw-r--r-- | internal/oauth/oauth.go | 7 |
1 files changed, 6 insertions, 1 deletions
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) } |
