rack-protection 3.0.5 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7fef35d427c0ff406165fdf913c53089e65f94d759aaf5610aebd5ef0c43cd30
4
- data.tar.gz: 4a458e4fada2015274bde82e4209bfe4c94618227fc7a2dc8df198258c1b7404
3
+ metadata.gz: eeb2f23054ca1be134853965356c94ce919a74971330a244184c45b92afbc9a9
4
+ data.tar.gz: 510bd7c9386b0611547bd8f0cfe97ac959428a967e9095ae3f1345c29126bae1
5
5
  SHA512:
6
- metadata.gz: e8b1ba3b66ae172be989c43133f111fbe416706df83735f51aa785146242bbab8e55c5b0fa4667dff165ac462db518c1209f9957ec3bf95744da1dc4881cd5c9
7
- data.tar.gz: cd46380780ad4c7078a6fc31f46cfaa6dda79bcbf2b47cf6e973592d85c35d4ef1c0bff5fee0b910e29e5cb579307447eae4d4c5880f2440586ee204a9d37da8
6
+ metadata.gz: ec9549d7c63593ace699212d5d6df2747f0d4a7f02b33e280f6af887458b426e6c305e36e73a78ae154023205f4239e033cf849d39e43b4b149dc0de4f33b8a0
7
+ data.tar.gz: 32f7feb53458c5336fa91043ecfba414348a1a77e12b55a8cc7cfdbf099ec33184a6faf27ccb818bce5ffe073f83bdd77fd803dadc7ae101acbcf67c35673311
data/Gemfile CHANGED
@@ -7,7 +7,7 @@ gem 'rake'
7
7
 
8
8
  rack_version = ENV['rack'].to_s
9
9
  rack_version = nil if rack_version.empty? || (rack_version == 'stable')
10
- rack_version = { github: 'rack/rack' } if rack_version == 'main'
10
+ rack_version = { github: 'rack/rack' } if rack_version == 'head'
11
11
  gem 'rack', rack_version
12
12
 
13
13
  gem 'sinatra', path: '..'
data/README.md CHANGED
@@ -74,6 +74,7 @@ Prevented by:
74
74
  ## Cookie Tossing
75
75
 
76
76
  Prevented by:
77
+
77
78
  * [`Rack::Protection::CookieTossing`][cookie-tossing] (not included by `use Rack::Protection`)
78
79
 
79
80
  ## IP Spoofing
@@ -95,6 +96,7 @@ Prevented by:
95
96
  # Instrumentation
96
97
 
97
98
  Instrumentation is enabled by passing in an instrumenter as an option.
99
+
98
100
  ```
99
101
  use Rack::Protection, instrumenter: ActiveSupport::Notifications
100
102
  ```
@@ -93,7 +93,13 @@ module Rack
93
93
  end
94
94
 
95
95
  def drop_session(env)
96
- session(env).clear if session? env
96
+ return unless session? env
97
+
98
+ session(env).clear
99
+
100
+ return if ["1", "true"].include?(ENV["RACK_PROTECTION_SILENCE_DROP_SESSION_WARNING"])
101
+
102
+ warn env, "session dropped by #{self.class}"
97
103
  end
98
104
 
99
105
  def referrer(env)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rack
4
4
  module Protection
5
- VERSION = '3.0.4'
5
+ VERSION = '3.1.0'
6
6
  end
7
7
  end
@@ -6,9 +6,9 @@ Gem::Specification.new do |s|
6
6
  # general infos
7
7
  s.name = 'rack-protection'
8
8
  s.version = version
9
- s.description = 'Protect against typical web attacks, works with all Rack apps, including Rails.'
10
- s.homepage = 'http://sinatrarb.com/protection/'
11
- s.summary = s.description
9
+ s.description = 'Protect against typical web attacks, works with all Rack apps, including Rails'
10
+ s.homepage = 'https://sinatrarb.com/protection/'
11
+ s.summary = "#{s.description}."
12
12
  s.license = 'MIT'
13
13
  s.authors = ['https://github.com/sinatra/sinatra/graphs/contributors']
14
14
  s.email = 'sinatrarb@googlegroups.com'
@@ -30,7 +30,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
30
30
  end
31
31
 
32
32
  s.metadata = {
33
- 'source_code_uri' => 'https://github.com/sinatra/sinatra/tree/master/rack-protection',
33
+ 'source_code_uri' => 'https://github.com/sinatra/sinatra/tree/main/rack-protection',
34
34
  'homepage_uri' => 'http://sinatrarb.com/protection/',
35
35
  'documentation_uri' => 'https://www.rubydoc.info/gems/rack-protection',
36
36
  'rubygems_mfa_required' => 'true'
@@ -39,7 +39,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
39
39
  s.required_ruby_version = '>= 2.6.0'
40
40
 
41
41
  # dependencies
42
- s.add_dependency 'rack'
42
+ s.add_dependency 'rack', '~> 2.2', '>= 2.2.4'
43
43
  s.add_development_dependency 'rack-test', '~> 2'
44
44
  s.add_development_dependency 'rspec', '~> 3'
45
45
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-protection
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - https://github.com/sinatra/sinatra/graphs/contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-16 00:00:00.000000000 Z
11
+ date: 2023-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.2'
17
20
  - - ">="
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 2.2.4
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '2.2'
24
30
  - - ">="
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 2.2.4
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rack-test
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +59,7 @@ dependencies:
53
59
  - !ruby/object:Gem::Version
54
60
  version: '3'
55
61
  description: Protect against typical web attacks, works with all Rack apps, including
56
- Rails.
62
+ Rails
57
63
  email: sinatrarb@googlegroups.com
58
64
  executables: []
59
65
  extensions: []
@@ -87,11 +93,11 @@ files:
87
93
  - lib/rack/protection/xss_header.rb
88
94
  - lib/rack_protection.rb
89
95
  - rack-protection.gemspec
90
- homepage: http://sinatrarb.com/protection/
96
+ homepage: https://sinatrarb.com/protection/
91
97
  licenses:
92
98
  - MIT
93
99
  metadata:
94
- source_code_uri: https://github.com/sinatra/sinatra/tree/master/rack-protection
100
+ source_code_uri: https://github.com/sinatra/sinatra/tree/main/rack-protection
95
101
  homepage_uri: http://sinatrarb.com/protection/
96
102
  documentation_uri: https://www.rubydoc.info/gems/rack-protection
97
103
  rubygems_mfa_required: 'true'
@@ -110,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
116
  - !ruby/object:Gem::Version
111
117
  version: '0'
112
118
  requirements: []
113
- rubygems_version: 3.2.3
119
+ rubygems_version: 3.4.18
114
120
  signing_key:
115
121
  specification_version: 4
116
122
  summary: Protect against typical web attacks, works with all Rack apps, including