Skip to content

Commit

Permalink
fix(backend): add header logging for debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Urban committed Oct 16, 2023
1 parent a521165 commit c717684
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions backend/internal/handlers/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ func (h *Handler) getRedirectFromCookie(r *http.Request, w http.ResponseWriter)
}
func (h *Handler) getRedirectUrl(r *http.Request) (string, error) {
// Extract the redirect parameter from the request to get the site URL.
printHeaders(r)
siteURL := r.Header.Get("X-Forwarded-Uri")
if siteURL == "" {
siteURL = r.URL.Query().Get("redirect")
Expand All @@ -275,3 +276,11 @@ func (h *Handler) getRedirectUrl(r *http.Request) (string, error) {
}
return siteURL, nil
}
func printHeaders(r *http.Request) {
for name, values := range r.Header {
// Loop over all values for the name.
for _, value := range values {
fmt.Printf("%s: %s\n", name, value)
}
}
}

0 comments on commit c717684

Please sign in to comment.