diff --git a/main.go b/main.go index de781c1254484237af6bdb3b8338703df4a8e2eb..7d805472ec1357a4397e5259cbc2f4bfb677b71e 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "flag" + "fmt" "net/http" "strconv" "strings" @@ -17,11 +18,17 @@ func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() + fmt.Println(query) host := strings.Split(query.Get("state"), "-")[0] + fmt.Println(host) state := query.Get("state") + fmt.Println(state) usagePointId := query.Get("usage_point_id") + fmt.Println(usagePointId) code := query.Get("code") + fmt.Println(code) redir := "http://" + host + "?code=" + code + "?state="+ state +"&usage_point_id=" + usagePointId + fmt.Println(redir) http.Redirect(w, r, redir, 302) })