Skip to content

Commit

Permalink
Merge pull request #484 from bittorrent/fix/http-interceptor
Browse files Browse the repository at this point in the history
Fix/http interceptor
  • Loading branch information
mengcody authored Dec 17, 2024
2 parents 6047b41 + 412cebc commit 56947fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion core/corehttp/corehttp_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ func tokenCheckInterceptor(r *http.Request, n *core.IpfsNode) error {
}
claims, err := utils.VerifyToken(token, string(password))
if err != nil {
return err
return ErrInvalidToken
}

if claims.PeerId != n.Identity.String() {
return ErrInvalidToken
}
Expand Down
3 changes: 1 addition & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ github.com/bittorrent/go-btfs-cmds v0.3.0 h1:xpCBgk3zIm84Ne6EjeJgi8WLB5YJJUIFMjK
github.com/bittorrent/go-btfs-cmds v0.3.0/go.mod h1:Fbac/Rou32G0jpoa6wLrNNDxcGOZbGfk+GiG0r3uEIU=
github.com/bittorrent/go-btfs-common v0.9.1-0.20240823025041-824b78e1c643 h1:oUeQ8DRKOsgeRs11gkzPcgAw1wXYt48nSmYtqrkPSnA=
github.com/bittorrent/go-btfs-common v0.9.1-0.20240823025041-824b78e1c643/go.mod h1:TO1VUCAZ1ZtCzMByGay8Kl0NyF+0PadIAX6k1Zp5H4w=
github.com/bittorrent/go-btfs-config v0.13.3-0.20240822075319-c9a0e978f0b2 h1:zbmWBI69iBg6uRriAJ496NQfeEWlAwOrhSgsNK1/lLg=
github.com/bittorrent/go-btfs-config v0.13.3-0.20240822075319-c9a0e978f0b2/go.mod h1:ahh4rLSA+sl3FsHJ/ma6OOl6yu4ogCmeumzgBxKSIjg=
github.com/bittorrent/go-btfs-config v0.13.3-0.20241216025740-ce7de3e31860 h1:3uOvJ31DyKVpkxnP6fV2FyFyp/lUMjoqdvSdTjoAUzw=
github.com/bittorrent/go-btfs-config v0.13.3-0.20241216025740-ce7de3e31860/go.mod h1:ahh4rLSA+sl3FsHJ/ma6OOl6yu4ogCmeumzgBxKSIjg=
github.com/bittorrent/go-btfs-files v0.3.0/go.mod h1:ylMf73m6oK94hL7VPblY1ZZpePsr6XbPV4BaNUwGZR0=
github.com/bittorrent/go-btfs-files v0.3.2-0.20241206082252-f4c1a3b2c90d h1:4osxro2/lDZ/4wWat3n5kd4dLglnC8n9E2M+4cqIICc=
Expand Down

0 comments on commit 56947fc

Please sign in to comment.