Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Sep 29, 2023
1 parent 21b7034 commit 0d5e448
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cookie/cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,10 @@ func SetAntiReplay(r *http.Request, antiReplay string) *http.Request {
return r
}

// UseClientAntiReplay uses the client IP address and client TLS fingerprint to try and mitigate against [replay attacks].
// UseClientForAntiReplay uses the client IP address and client TLS fingerprint to try and mitigate against [replay attacks].
//
// [replay attacks]: https://en.wikipedia.org/wiki/Replay_attack
func UseClientAntiReplay(r *http.Request) *http.Request {
func UseClientForAntiReplay(r *http.Request) string {
ip := clientip.Get(
// Note:
// - client IP can be spoofed easily and this could lead to issues with their cookies.
Expand All @@ -299,5 +299,5 @@ func UseClientAntiReplay(r *http.Request) *http.Request {
r,
)

return SetAntiReplay(r, fmt.Sprintf("%s-%s", ip, fingerprint))
return fmt.Sprintf("%s-%s", ip, fingerprint)
}

0 comments on commit 0d5e448

Please sign in to comment.