Skip to content

Commit

Permalink
Fallback to Origin header if Referer is not set (#3599)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Bellamy authored May 17, 2021
1 parent 21155fc commit 0f6f3f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions services/horizon/internal/httpx/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ func logEndOfRequest(ctx context.Context, r *http.Request, requestDurationSummar
route := sanitizeMetricRoute(chi.RouteContext(r.Context()).RoutePattern())

referer := r.Referer()
if referer == "" {
referer = r.Header.Get("Origin")
}
if referer == "" {
referer = "undefined"
}
Expand Down

0 comments on commit 0f6f3f6

Please sign in to comment.