1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-01 00:45:46 +00:00

Revert "If httpsig verification fails, fix Host header and try again"

This reverts commit f53e46c721.

The bug was actually caused by nginx messing up the Host header when reverse-proxying since I didn't have the line `proxy_set_header Host $host;` in my nginx config for Gitea.
This commit is contained in:
Anthony Wang 2022-06-14 21:05:16 -05:00
parent f53e46c721
commit 14cfd8de23
No known key found for this signature in database
GPG Key ID: BC96B00AEC5F2D76

View File

@ -90,16 +90,6 @@ func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, er
// 3. Verify the other actor's key
algo := httpsig.Algorithm(setting.Federation.Algorithms[0])
authenticated = v.Verify(pubKey, algo) == nil
if authenticated {
return
}
// 4. When Gitea and the other ActivityPub server are running on the same machine, the Host header is sometimes incorrect
r.Header["Host"] = []string{setting.Domain}
v, err = httpsig.NewVerifier(r)
if err != nil {
return
}
authenticated = v.Verify(pubKey, algo) == nil
return
}