Skip to content
Snippets Groups Projects
Commit e2b9223f authored by Yoan VALLET's avatar Yoan VALLET
Browse files

Update main.go - review of state splitting

parent 51f8cbd5
Branches
No related tags found
No related merge requests found
Pipeline #5391 passed
...@@ -170,8 +170,13 @@ func main() { ...@@ -170,8 +170,13 @@ func main() {
code := query.Get("code") code := query.Get("code")
req_state := query.Get("state") req_state := query.Get("state")
state := strings.Split(req_state, "-")[0]
host := strings.Split(req_state, "-")[1] splitIndex := strings.Index(req_state, "-")
if splitIndex == -1 {
fmt.Println("No host found")
}
state := string([]byte(req_state[0:splitIndex]))
host := string([]byte(req_state[splitIndex+1:len(req_state)]))
usagePointId := query.Get("usage_point_id") usagePointId := query.Get("usage_point_id")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment