[bugfix] Set the Host header within the signing transport (#2799)

This commit is contained in:
kim 2024-04-02 13:28:36 +01:00 committed by GitHub
commit e664d0918b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 3 additions and 9 deletions

View file

@ -68,7 +68,6 @@ func prepWebfingerReq(ctx context.Context, loc, domain, username string) (*http.
// including Gin itself. So concat the accept header with a comma
// instead which seems to work reliably
req.Header.Add("Accept", string(apiutil.AppJRDJSON)+","+string(apiutil.AppJSON))
req.Header.Set("Host", req.URL.Host)
return req, nil
}
@ -187,7 +186,6 @@ func (t *transport) webfingerFromHostMeta(ctx context.Context, targetDomain stri
// We're doing XML
req.Header.Add("Accept", string(apiutil.AppXML))
req.Header.Add("Accept", "application/xrd+xml")
req.Header.Set("Host", req.URL.Host)
// Perform the HTTP request
rsp, err := t.GET(req)