Problem: need url for login
All checks were successful
continuous-integration/drone/push Build is passing

Solution: create url when input does not parse
This commit is contained in:
Peter Stuifzand 2022-04-27 20:44:21 +02:00
parent b33cfeb395
commit f617dd973f

View File

@ -293,8 +293,12 @@ func (*authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
u, err := url.Parse(urlString) u, err := url.Parse(urlString)
if err != nil { if err != nil {
http.Error(w, err.Error(), 400) urlString = fmt.Sprintf("https://%s/", urlString)
return u, err = url.Parse(urlString)
if err != nil {
http.Error(w, err.Error(), 400)
return
}
} }
endpoints, err := indieauth.GetEndpoints(u) endpoints, err := indieauth.GetEndpoints(u)