From 899b4f9d98612efb3ff8a494305fad630b0028e7 Mon Sep 17 00:00:00 2001 From: Marius Kleidl Date: Fri, 9 Jun 2023 12:34:10 +0200 Subject: [PATCH] fixup! Merge branch 'main' of github.com:tus/tusd into v2 --- pkg/handler/hooks.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/handler/hooks.go b/pkg/handler/hooks.go index 08fc76d..eeb3680 100644 --- a/pkg/handler/hooks.go +++ b/pkg/handler/hooks.go @@ -13,6 +13,12 @@ type HookEvent struct { } func newHookEvent(info FileInfo, r *http.Request) HookEvent { + // The Host header field is not present in the header map, see https://pkg.go.dev/net/http#Request: + // > For incoming requests, the Host header is promoted to the + // > Request.Host field and removed from the Header map. + // That's why we add it back manually. + r.Header.Set("Host", r.Host) + return HookEvent{ Upload: info, HTTPRequest: HTTPRequest{