mirror of
https://github.com/neocities/neocities.git
synced 2025-08-03 08:11:56 +02:00
Update csrf_safe? to check the headers. Add some JS code to insert the CSRF token into the XHR request headers.
This commit is contained in:
parent
bdfaf0022a
commit
bcf9b63fa4
2 changed files with 13 additions and 2 deletions
2
app.rb
2
app.rb
|
@ -252,7 +252,7 @@ def require_login_ajax
|
|||
end
|
||||
|
||||
def csrf_safe?
|
||||
csrf_token == params[:csrf_token]
|
||||
csrf_token == params[:csrf_token] || csrf_token == request.env['HTTP_X_CSRF_TOKEN']
|
||||
end
|
||||
|
||||
def csrf_token
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue