Use middleware Rack::Head, Rack::Protection
This commit is contained in:
parent
8408e342a6
commit
7d66cef6bc
2 changed files with 6 additions and 3 deletions
|
@ -45,6 +45,7 @@ Gem::Specification.new do |spec|
|
||||||
|
|
||||||
spec.add_runtime_dependency 'puma', '~> 6.2', '>= 6.2.2'
|
spec.add_runtime_dependency 'puma', '~> 6.2', '>= 6.2.2'
|
||||||
spec.add_runtime_dependency 'rack', '~> 2.2', '>= 2.2.7'
|
spec.add_runtime_dependency 'rack', '~> 2.2', '>= 2.2.7'
|
||||||
|
spec.add_runtime_dependency 'rack-protection', '~> 3.0', '>= 3.0.6'
|
||||||
spec.add_runtime_dependency 'sinatra', '~> 3.0', '>= 3.0.6'
|
spec.add_runtime_dependency 'sinatra', '~> 3.0', '>= 3.0.6'
|
||||||
|
|
||||||
spec.add_development_dependency 'bundler', '~> 2.4'
|
spec.add_development_dependency 'bundler', '~> 2.4'
|
||||||
|
|
|
@ -21,7 +21,9 @@ module Diversipub
|
||||||
|
|
||||||
def builder
|
def builder
|
||||||
@builder ||= Rack::Builder.new.tap do |builder|
|
@builder ||= Rack::Builder.new.tap do |builder|
|
||||||
|
builder.use Rack::Head
|
||||||
builder.use Rack::Static, **rack_static_kwargs
|
builder.use Rack::Static, **rack_static_kwargs
|
||||||
|
builder.use Rack::Protection
|
||||||
builder.run @sinatra_app
|
builder.run @sinatra_app
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue