rack-ssl 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rack-ssl might be problematic. Click here for more details.

Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/rack/ssl.rb +8 -7
  3. metadata +11 -16
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 39ffec4cba9fa627c631f6918127cdffa0465347
4
+ data.tar.gz: 24d2eef19474804739a8de8c83a52e88261a4ab4
5
+ SHA512:
6
+ metadata.gz: 3f64885c726eb1b0fd929e23a7cb7532a0c4745daaffa567d2c6a344aec75e43e9bb22cf608a3597c4d090196179827dc61acd1fc33b189261db430fe4314736
7
+ data.tar.gz: 98c4f268463a1732ee25f0e4f638750333395d9e82b1587d843f49a3b29c4e750a13b8dfd38f00ce4b7f3d511d0898443f9f46c1130a3a9a1f2f6f7b357d26de
@@ -46,13 +46,14 @@ module Rack
46
46
  end
47
47
 
48
48
  def redirect_to_https(env)
49
- req = Request.new(env)
50
- url = URI(req.url)
51
- url.scheme = "https"
52
- url.host = @host if @host
53
- status = %w[GET HEAD].include?(req.request_method) ? 301 : 307
54
- headers = hsts_headers.merge('Content-Type' => 'text/html',
55
- 'Location' => url.to_s)
49
+ req = Request.new(env)
50
+
51
+ host = @host || req.host
52
+ location = "https://#{host}#{req.fullpath}"
53
+
54
+ status = %w[GET HEAD].include?(req.request_method) ? 301 : 307
55
+ headers = hsts_headers.merge('Content-Type' => 'text/html',
56
+ 'Location' => location)
56
57
 
57
58
  [status, headers, []]
58
59
  end
metadata CHANGED
@@ -1,35 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
5
- prerelease:
4
+ version: 1.3.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Joshua Peek
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-01-29 00:00:00.000000000 Z
11
+ date: 2014-03-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rack
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
- description: ! ' Rack middleware to force SSL/TLS.
31
-
32
- '
27
+ description: |2
28
+ Rack middleware to force SSL/TLS.
33
29
  email: josh@joshpeek.com
34
30
  executables: []
35
31
  extensions: []
@@ -40,27 +36,26 @@ files:
40
36
  - README.md
41
37
  homepage: https://github.com/josh/rack-ssl
42
38
  licenses: []
39
+ metadata: {}
43
40
  post_install_message:
44
41
  rdoc_options: []
45
42
  require_paths:
46
43
  - lib
47
44
  required_ruby_version: !ruby/object:Gem::Requirement
48
- none: false
49
45
  requirements:
50
- - - ! '>='
46
+ - - '>='
51
47
  - !ruby/object:Gem::Version
52
48
  version: '0'
53
49
  required_rubygems_version: !ruby/object:Gem::Requirement
54
- none: false
55
50
  requirements:
56
- - - ! '>='
51
+ - - '>='
57
52
  - !ruby/object:Gem::Version
58
53
  version: '0'
59
54
  requirements: []
60
55
  rubyforge_project: rack-ssl
61
- rubygems_version: 1.8.24
56
+ rubygems_version: 2.0.3
62
57
  signing_key:
63
- specification_version: 3
58
+ specification_version: 4
64
59
  summary: Force SSL/TLS in your app.
65
60
  test_files: []
66
61
  has_rdoc: