Use middleware Rack::Head, Rack::Protection

This commit is contained in:
Alex Kotov 2023-05-10 00:43:15 +04:00
parent 8408e342a6
commit 7d66cef6bc
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 6 additions and 3 deletions

View file

@ -43,9 +43,10 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename f } spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename f }
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 'sinatra', '~> 3.0', '>= 3.0.6' spec.add_runtime_dependency 'rack-protection', '~> 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'
spec.add_development_dependency 'pry', '~> 0.14' spec.add_development_dependency 'pry', '~> 0.14'

View file

@ -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