Problem: need url for login
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Solution: create url when input does not parse
This commit is contained in:
parent
b33cfeb395
commit
f617dd973f
4
main.go
4
main.go
|
@ -292,10 +292,14 @@ func (*authHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
urlString := r.PostFormValue("url")
|
urlString := r.PostFormValue("url")
|
||||||
|
|
||||||
u, err := url.Parse(urlString)
|
u, err := url.Parse(urlString)
|
||||||
|
if err != nil {
|
||||||
|
urlString = fmt.Sprintf("https://%s/", urlString)
|
||||||
|
u, err = url.Parse(urlString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
http.Error(w, err.Error(), 400)
|
http.Error(w, err.Error(), 400)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
endpoints, err := indieauth.GetEndpoints(u)
|
endpoints, err := indieauth.GetEndpoints(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user