Skip to content

Commit

Permalink
fix endless redirect when switching domains (#41)
Browse files Browse the repository at this point in the history
When a path like mydomain/graph is entered in the URL, maia redirects to mydomain/graph?, which ends up as mydomain/graph again. Endless loop.
  • Loading branch information
Joachim Barheine authored Mar 13, 2019
1 parent 2287fad commit f5fd9a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ func redirectToDomainRootPage(w http.ResponseWriter, r *http.Request) {
redirectToRootPage(w, r)
return
}
newPath := "/" + domain + "/graph?" + r.URL.RawQuery // keep the query part since this is where the token might go
newPath := "/" + domain + "/graph"
if r.URL.RawQuery != "" {
newPath += "?" + r.URL.RawQuery // keep the query part since this is where the token might go
}
util.LogDebug("Redirecting %s to %s", r.URL.Path, newPath)
http.Redirect(w, r, newPath, http.StatusFound)
}
Expand Down

0 comments on commit f5fd9a4

Please sign in to comment.