summaryrefslogtreecommitdiff
path: root/internal/httpclient/sign.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-04-02 13:28:36 +0100
committerLibravatar GitHub <noreply@github.com>2024-04-02 14:28:36 +0200
commite664d0918b2ea004a2498cb67a6e0b4b3b3666f3 (patch)
tree39b85b1a9ad67ac3ac6bae348e43e01de46993ed /internal/httpclient/sign.go
parent[bugfix] httpclient not signing subsequent redirect requests (#2798) (diff)
downloadgotosocial-e664d0918b2ea004a2498cb67a6e0b4b3b3666f3.tar.xz
[bugfix] Set the `Host` header within the signing transport (#2799)
Diffstat (limited to 'internal/httpclient/sign.go')
-rw-r--r--internal/httpclient/sign.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/httpclient/sign.go b/internal/httpclient/sign.go
index 8e66d1bda..6b561c45a 100644
--- a/internal/httpclient/sign.go
+++ b/internal/httpclient/sign.go
@@ -37,6 +37,9 @@ type signingtransport struct {
}
func (t *signingtransport) RoundTrip(r *http.Request) (*http.Response, error) {
+ // Ensure updated host always set.
+ r.Header.Set("Host", r.URL.Host)
+
if sign := gtscontext.HTTPClientSignFunc(r.Context()); sign != nil {
// Reset signing header fields
now := time.Now().UTC()