mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-01-17 00:16:35 +03: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:
parent
f53e46c721
commit
14cfd8de23
1 changed files with 0 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue