Skip to content

Commit f5b8ecc

Browse files
committed
fix: joining url using net/url
1 parent c7931aa commit f5b8ecc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

pkg/http/server.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"io"
77
"log/slog"
88
"net/http"
9+
"net/url"
910
"os"
1011
"os/signal"
1112
"slices"
@@ -128,7 +129,12 @@ func RunHTTPServer(cfg ServerConfig) error {
128129
ResourcePath: cfg.ResourcePath,
129130
}
130131
if cfg.Host != "" {
131-
oauthCfg.AuthorizationServer = cfg.Host + "login/oauth"
132+
u := &url.URL{
133+
Scheme: "https",
134+
Host: cfg.Host,
135+
Path: "/login/oauth",
136+
}
137+
oauthCfg.AuthorizationServer = u.String()
132138
}
133139

134140
serverOptions := []HandlerOption{}

0 commit comments

Comments
 (0)