Skip to content

Commit 14cfd8d

Browse files
author
Anthony Wang
committed
Revert "If httpsig verification fails, fix Host header and try again"
This reverts commit f53e46c. 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.
1 parent f53e46c commit 14cfd8d

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

routers/api/v1/activitypub/reqsignature.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,6 @@ func verifyHTTPSignatures(ctx *gitea_context.APIContext) (authenticated bool, er
9090
// 3. Verify the other actor's key
9191
algo := httpsig.Algorithm(setting.Federation.Algorithms[0])
9292
authenticated = v.Verify(pubKey, algo) == nil
93-
if authenticated {
94-
return
95-
}
96-
// 4. When Gitea and the other ActivityPub server are running on the same machine, the Host header is sometimes incorrect
97-
r.Header["Host"] = []string{setting.Domain}
98-
v, err = httpsig.NewVerifier(r)
99-
if err != nil {
100-
return
101-
}
102-
authenticated = v.Verify(pubKey, algo) == nil
10393
return
10494
}
10595

0 commit comments

Comments
 (0)