Skip to content

Commit

Permalink
logged r.Host when available
Browse files Browse the repository at this point in the history
  • Loading branch information
aryan-p03 committed Jan 20, 2025
1 parent c5013c6 commit b5cc7c3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions links/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ func FromHeadersOrDefault(h *http.Header, r *http.Request, defaultURL *url.URL)
host := h.Get("X-Forwarded-Host")
if host == "" {
if r.Host != "" {
log.Info(r.Context(), "using request host instead of default host", log.Data{
"host": r.Host,
})
defaultURL.Host = r.Host
}
defaultURL = defaultURL.JoinPath(path)
Expand Down

0 comments on commit b5cc7c3

Please sign in to comment.