Skip to content

Commit

Permalink
Add cookie option in CSRF
Browse files Browse the repository at this point in the history
  • Loading branch information
dongxuny committed Apr 9, 2024
1 parent 1f210eb commit 32a6cef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions middleware/csrf/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ func NewOptionSet(opts ...Option) OptionSetInterface {
parts := strings.Split(set.tokenLookup, ":")
set.extractor = csrfTokenFromHeader(parts[1])
switch parts[0] {
case "cookie":
set.extractor = csrfTokenFromCookie(parts[1])
case "form":
set.extractor = csrfTokenFromForm(parts[1])
case "query":
Expand Down

0 comments on commit 32a6cef

Please sign in to comment.