From b5cc7c3e829138a2f32b46b9a75ff014d753dc99 Mon Sep 17 00:00:00 2001 From: aryan-patel Date: Mon, 20 Jan 2025 10:57:33 +0000 Subject: [PATCH] logged r.Host when available --- links/links.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/links/links.go b/links/links.go index fa1d9d7..4f7bbf1 100644 --- a/links/links.go +++ b/links/links.go @@ -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)