Skip to content
Snippets Groups Projects
Commit 5f8650d5 authored by Hugo NOUTS's avatar Hugo NOUTS
Browse files

log entry query, variables, redirection query

parent 83e6451c
Branches
No related tags found
No related merge requests found
Pipeline #4915 passed
......@@ -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)
})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment