Skip to content

Commit

Permalink
Update csrf.go
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw authored Jul 6, 2022
1 parent 198af5d commit 3c4cb68
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/csrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,17 @@ func getToken(r *http.Request) (actualToken string) {
return c.Value
}

fromHeader := func() string {
return r.Header.Get(csrfHeader)
}

fromForm := func() string {
if err := r.ParseForm(); err != nil {
return ""
}
return r.Form.Get(csrfCookieForm)
}

fromHeader := func() string {
return r.Header.Get(csrfHeader)
}

tok := fromCookie()
if tok == "" {
tok = fromForm()
Expand Down

0 comments on commit 3c4cb68

Please sign in to comment.