Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Protect all active storage controllers agains CSRF
Before it was possible to for example use the direct upload controller without using the site.
- Loading branch information
1 parent
b71b8ec
commit 03bd370
Showing
5 changed files
with
11 additions
and
5 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
activestorage/app/controllers/active_storage/base_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
# The base controller for all ActiveStorage controllers. | ||
class ActiveStorage::BaseController < ActionController::Base | ||
protect_from_forgery with: :exception | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters