rack-ssl 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rack/ssl.rb +7 -8
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7715458599c0d8e028009ef2b48f3fa74e82781b
4
- data.tar.gz: cb6a4ba8e8b7a5c8bd64bdb68c4629e49f27a089
3
+ metadata.gz: aa61f71b6c14a4e23c45b7e8010cda8fc7707b87
4
+ data.tar.gz: 1c951c415524973dce7728fdc624134462138b31
5
5
  SHA512:
6
- metadata.gz: 240abd92950b661de6c5cadf0a05a506bea06fe8ff77964e868d3579af68fe4bcca62165c6b78b7ffc807c831143972f083b860ff24cb4e7ed0284be6f30723a
7
- data.tar.gz: 875c8ba898a9526102a5910387438d65363e2200fb8bf5d0821c80d2d9a08bcfbcc52e67979e8f8c3f733284d405f021329feebe7f743328c53e410ed444879a
6
+ metadata.gz: 0a3c6192b67eeb7d6a3ff1c09f1d37369b8160b3acdcadf50ac04827d188731c4371598e9ecb7e7d45647684a4ed89836377821a002bd3c089d5b49afc360670
7
+ data.tar.gz: 1c21cbee87a2faf372ead0a249be3b26d188600920f9001e61a3aa00e18942cfd6ebbb440be9e03d33b21f0594f0005ae0bbafc40d8c3b781fb86048e5d2b617
@@ -46,16 +46,15 @@ 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 = { 'Content-Type' => 'text/html', '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 = { 'Content-Type' => 'text/html', 'Location' => location }
55
56
 
56
57
  [status, headers, []]
57
- rescue URI::InvalidURIError
58
- [400, {"Content-Type" => "text/plain"}, []]
59
58
  end
60
59
 
61
60
  # http://tools.ietf.org/html/draft-hodges-strict-transport-sec-02
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-ssl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Peek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-17 00:00:00.000000000 Z
11
+ date: 2014-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -59,3 +59,4 @@ signing_key:
59
59
  specification_version: 4
60
60
  summary: Force SSL/TLS in your app.
61
61
  test_files: []
62
+ has_rdoc: