Skip to content

Commit c8193fa

Browse files
authored
Avoid "listen tcp: address localhost: missing port in address" (#126)
1 parent f252efa commit c8193fa

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/oauth2/oauth2.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ func WaitForCallback(clientConfig ClientConfig, serverConfig ServerConfig, hc *h
233233
srv.TLSConfig = &tls.Config{
234234
Certificates: []tls.Certificate{cert},
235235
}
236+
if redirectURL.Port() == "" {
237+
srv.Addr += ":443"
238+
}
239+
} else {
240+
if redirectURL.Port() == "" {
241+
srv.Addr += ":80"
242+
}
236243
}
237244

238245
http.HandleFunc(redirectURL.Path, func(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)