spinels-rack-ssl-enforcer 0.3.0 → 1.0.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: 3733938868eed1e628160489ff7e1e037bf2258bbbccc4c711f976b9a7292b78
4
- data.tar.gz: 9dcace39e52062c55a6ad68490dd750382e0d9400a22e6f315d4dadf1918e961
3
+ metadata.gz: 593aebbc3813e49fba1056df4f68f4eee2a0f9a5079655f67d55f00469b30988
4
+ data.tar.gz: d1f27884e1e6a1aa7d5ea5deccd00aac5de342322175381bf8e28327b4f35522
5
5
  SHA512:
6
- metadata.gz: e38fa0bd54a6693492983439f9bfe6f709093b2529bfe233469bc787ad82d83f948960e1868613b5f8c53c8aec948712404eade6428cfdfadcc30917df17bb55
7
- data.tar.gz: d4812f9e02c859da5f3f4545e0a6a03d41376bd723ec7e850dc8212d984ae17d0d5a42442842578cc323564569cdfbe55ae8c3aeffb8d15c62e634d1395a0473
6
+ metadata.gz: dbfe47663b655a60d62fb141b746ca849704446de2ef91194ed36194b9b6277ebc8f420072059b1e13e68ffe908adb42eab663c9d2df1314418b363fd978bbdb
7
+ data.tar.gz: ceb9d49762932d5ca547163892611d2b4789d546c6304da90e013ce52ab0f6317a4f301564c1508209cf696420e3d0d2c4c7a0de8e12ae1c36bb645be97de218
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class SslEnforcer
3
- VERSION = "0.3.0"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -93,7 +93,7 @@ module Rack
93
93
  location = replace_host(location, req, @options[:redirect_to])
94
94
  redirect_to(location)
95
95
  rescue URI::InvalidURIError
96
- [400, { 'Content-Type' => 'text/plain'}, []]
96
+ [400, { 'content-type' => 'text/plain'}, []]
97
97
  end
98
98
 
99
99
  def redirect_to(location)
@@ -102,7 +102,7 @@ module Rack
102
102
  body << @options[:redirect_html] if @options[:redirect_html].is_a?(String)
103
103
  body = @options[:redirect_html] if @options[:redirect_html].respond_to?('each')
104
104
 
105
- [@options[:redirect_code] || 301, { 'Content-Type' => 'text/html', 'Location' => location }, body]
105
+ [@options[:redirect_code] || 301, { 'content-type' => 'text/html', 'location' => location }, body]
106
106
  end
107
107
 
108
108
  def ssl_request?(req)
@@ -181,15 +181,15 @@ module Rack
181
181
 
182
182
  # see http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_theft_and_session_hijacking
183
183
  def flag_cookies_as_secure!(headers)
184
- if cookies = headers['Set-Cookie']
184
+ if cookies = headers['set-cookie']
185
185
  # Support Rails 2.3 / Rack 1.1 arrays as headers
186
186
  unless cookies.is_a?(Array)
187
187
  cookies = cookies.split("\n")
188
188
  end
189
189
 
190
- headers['Set-Cookie'] = cookies.map do |cookie|
190
+ headers['set-cookie'] = cookies.map do |cookie|
191
191
  cookie !~ /(^|;\s)secure($|;)/ ? "#{cookie}; secure" : cookie
192
- end.join("\n")
192
+ end
193
193
  end
194
194
  end
195
195
 
@@ -200,7 +200,7 @@ module Rack
200
200
  value = "max-age=#{opts[:expires]}"
201
201
  value += "; includeSubDomains" if opts[:subdomains]
202
202
  value += "; preload" if opts[:preload]
203
- headers.merge!({ 'Strict-Transport-Security' => value })
203
+ headers.merge!({ 'strict-transport-security' => value })
204
204
  end
205
205
 
206
206
  end
metadata CHANGED
@@ -1,16 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spinels-rack-ssl-enforcer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Matthies
8
8
  - Thibaud Guillaume-Gentil
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-09 00:00:00.000000000 Z
13
- dependencies: []
12
+ date: 2024-08-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ">="
19
+ - !ruby/object:Gem::Version
20
+ version: 3.0.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ version: 3.0.0
14
28
  description: Rack::SslEnforcer is a simple Rack middleware to enforce ssl connections
15
29
  email:
16
30
  - github@tobiasmatthies.de
@@ -31,7 +45,7 @@ licenses:
31
45
  - MIT
32
46
  metadata:
33
47
  rubygems_mfa_required: 'true'
34
- post_install_message:
48
+ post_install_message:
35
49
  rdoc_options: []
36
50
  require_paths:
37
51
  - lib
@@ -39,15 +53,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
53
  requirements:
40
54
  - - ">="
41
55
  - !ruby/object:Gem::Version
42
- version: 1.9.3
56
+ version: 3.1.0
43
57
  required_rubygems_version: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
46
60
  - !ruby/object:Gem::Version
47
61
  version: 1.3.6
48
62
  requirements: []
49
- rubygems_version: 3.2.33
50
- signing_key:
63
+ rubygems_version: 3.5.11
64
+ signing_key:
51
65
  specification_version: 4
52
66
  summary: A simple Rack middleware to enforce SSL
53
67
  test_files: []