Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
csrf
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalshkeir committed Aug 30, 2022
1 parent 6cd22f9 commit a8f2af3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/kamux/csrf/csrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var CSRF = func(handler http.Handler) http.Handler {
case "POST","PATCH","PUT","UPDATE","DELETE":
token := r.Header.Get("X-CSRF-Token")
tok,ok := Csrf_tokens.Get(token)
if !ok || token == "" || tok.Used || tok.Retry > CSRF_TIMEOUT_RETRY || time.Since(tok.Created) > CSRF_CLEAN_EVERY || r.UserAgent() != tok.Remote {
if !ok || token == "" || tok.Used || tok.Retry > CSRF_TIMEOUT_RETRY || time.Since(tok.Created) > CSRF_CLEAN_EVERY {
eventbus.Publish("csrf-clean",tok.Value)
w.WriteHeader(http.StatusBadRequest)
json.NewEncoder(w).Encode(map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.63
1.0.64

0 comments on commit a8f2af3

Please sign in to comment.