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.
- checksums.yaml +4 -4
- data/lib/rack/ssl.rb +7 -8
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa61f71b6c14a4e23c45b7e8010cda8fc7707b87
|
4
|
+
data.tar.gz: 1c951c415524973dce7728fdc624134462138b31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a3c6192b67eeb7d6a3ff1c09f1d37369b8160b3acdcadf50ac04827d188731c4371598e9ecb7e7d45647684a4ed89836377821a002bd3c089d5b49afc360670
|
7
|
+
data.tar.gz: 1c21cbee87a2faf372ead0a249be3b26d188600920f9001e61a3aa00e18942cfd6ebbb440be9e03d33b21f0594f0005ae0bbafc40d8c3b781fb86048e5d2b617
|
data/lib/rack/ssl.rb
CHANGED
@@ -46,16 +46,15 @@ module Rack
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def redirect_to_https(env)
|
49
|
-
req
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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.
|
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-
|
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:
|