mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Introducing :use
This commit is contained in:
parent
1a2c79a66d
commit
5f093d57e8
1 changed files with 4 additions and 0 deletions
|
@ -20,7 +20,11 @@ module Rack
|
|||
def self.new(app, options = {})
|
||||
# does not include: RemoteReferrer, AuthenticityToken and FormToken
|
||||
except = Array options[:except]
|
||||
use_these = Array options[:use]
|
||||
Rack::Builder.new do
|
||||
use ::Rack::Protection::RemoteReferrer, options if use_these.include? :remote_referrer
|
||||
use ::Rack::Protection::AuthenticityToken,options if use_these.include? :authenticity_token
|
||||
use ::Rack::Protection::FormToken, options if use_these.include? :form_token
|
||||
use ::Rack::Protection::FrameOptions, options unless except.include? :frame_options
|
||||
use ::Rack::Protection::HttpOrigin, options unless except.include? :http_origin
|
||||
use ::Rack::Protection::IPSpoofing, options unless except.include? :ip_spoofing
|
||||
|
|
Loading…
Add table
Reference in a new issue