rack-ssl 1.3.4 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/rack/ssl.rb +8 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7715458599c0d8e028009ef2b48f3fa74e82781b
|
4
|
+
data.tar.gz: cb6a4ba8e8b7a5c8bd64bdb68c4629e49f27a089
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 240abd92950b661de6c5cadf0a05a506bea06fe8ff77964e868d3579af68fe4bcca62165c6b78b7ffc807c831143972f083b860ff24cb4e7ed0284be6f30723a
|
7
|
+
data.tar.gz: 875c8ba898a9526102a5910387438d65363e2200fb8bf5d0821c80d2d9a08bcfbcc52e67979e8f8c3f733284d405f021329feebe7f743328c53e410ed444879a
|
data/README.md
CHANGED
data/lib/rack/ssl.rb
CHANGED
@@ -46,16 +46,16 @@ module Rack
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def redirect_to_https(env)
|
49
|
-
req
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
headers = hsts_headers.merge('Content-Type' => 'text/html',
|
56
|
-
'Location' => location)
|
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 }
|
57
55
|
|
58
56
|
[status, headers, []]
|
57
|
+
rescue URI::InvalidURIError
|
58
|
+
[400, {"Content-Type" => "text/plain"}, []]
|
59
59
|
end
|
60
60
|
|
61
61
|
# 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
|
+
version: 1.4.0
|
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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -35,7 +35,8 @@ files:
|
|
35
35
|
- LICENSE
|
36
36
|
- README.md
|
37
37
|
homepage: https://github.com/josh/rack-ssl
|
38
|
-
licenses:
|
38
|
+
licenses:
|
39
|
+
- MIT
|
39
40
|
metadata: {}
|
40
41
|
post_install_message:
|
41
42
|
rdoc_options: []
|
@@ -58,4 +59,3 @@ signing_key:
|
|
58
59
|
specification_version: 4
|
59
60
|
summary: Force SSL/TLS in your app.
|
60
61
|
test_files: []
|
61
|
-
has_rdoc:
|