Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Go 1.13 does not have Map.Has. Use Get instead
Browse files Browse the repository at this point in the history
  • Loading branch information
cg2v committed Jun 20, 2022
1 parent c0070ef commit 56a9b01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions auth/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (c callback) ServeHTTP(w http.ResponseWriter, req *http.Request) {
fmt.Fprintln(w, "</body></html>")
return
}
if req.Form.Has("error") {
if req.Form.Get("error") != "" {
fmt.Printf("authentication failed, server response is %s\n", req.Form.Get("error"))
c.bad <- true
fmt.Fprintln(w, "<html><head>")
Expand All @@ -52,7 +52,7 @@ func (c callback) ServeHTTP(w http.ResponseWriter, req *http.Request) {
return
}

if !req.Form.Has("code") || !req.Form.Has("state") {
if req.Form.Get("code") == "" || req.Form.Get("state") == "" {
fmt.Println("callback request is missing parameters")
w.WriteHeader(400)
fmt.Fprintln(w, "<html><head>")
Expand Down

0 comments on commit 56a9b01

Please sign in to comment.