Skip to content

Commit

Permalink
Merge branch 'master' into update_gorp_path
Browse files Browse the repository at this point in the history
  • Loading branch information
haruyama committed Jan 25, 2015
2 parents f4a4f79 + d538043 commit 6fcf6af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions system/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,13 @@ func (application *Application) ApplyCsrfProtection(c *web.C, h http.Handler) ht
if c.Env["IsXhr"].(bool) {
if !isValidToken(csrfToken, r.Header.Get(csrfProtection.Header)) {
http.Error(w, "Invalid Csrf Header", http.StatusBadRequest)
return
}
} else {
if isCsrfProtectionMethodForNoXhr(r.Method) {
if !isValidToken(csrfToken, r.PostFormValue(csrfProtection.Key)) {
http.Error(w, "Invalid Csrf Token", http.StatusBadRequest)
return
}
}
}
Expand Down

0 comments on commit 6fcf6af

Please sign in to comment.