From 56a9b012520be82de6ac1a3fc13f8ccdb211bcbd Mon Sep 17 00:00:00 2001 From: Chaskiel Grundman Date: Mon, 20 Jun 2022 18:02:17 -0400 Subject: [PATCH] Go 1.13 does not have Map.Has. Use Get instead --- auth/listener.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/listener.go b/auth/listener.go index 53f12c50..3ac5cdef 100644 --- a/auth/listener.go +++ b/auth/listener.go @@ -41,7 +41,7 @@ func (c callback) ServeHTTP(w http.ResponseWriter, req *http.Request) { fmt.Fprintln(w, "") 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, "") @@ -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, "")