rails_slb_middleware 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/lib/rails_slb_middleware.rb +4 -4
- data/lib/rails_slb_middleware/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acd0236a988d2aa8e6c2e8f98d333671bac08462
|
4
|
+
data.tar.gz: 05a9b3890dd67f6d32892fbf661edc97c1260a72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef5610d161ff14f202516d30dfab6c0f7a3083a3e07e47e88fc65b80baf067b15c143745211d67c4c146f4fbd0c8a5677d20b99658a551835c196ce1351f477f
|
7
|
+
data.tar.gz: 0646c645d46c0cd618e22019dec5b58adaa897a206fcb3e60f4f3e2b4a04d3f7b33e8c87238a755d20efcff5f4bf6b5a9307ffd1e36f0393262b2e00ef089301
|
data/.gitignore
CHANGED
data/lib/rails_slb_middleware.rb
CHANGED
@@ -10,14 +10,14 @@ class RailsSlbMiddleware
|
|
10
10
|
def call(env)
|
11
11
|
req = Rack::Request.new(env)
|
12
12
|
|
13
|
-
if @force_rewrite_https && req.get_header("HTTP_X_FORWARDED_PROTO") == "https" && req.scheme == "http"
|
14
|
-
return [301, {"Location" => req.url.gsub(/^http/, "https")}, []]
|
15
|
-
end
|
16
|
-
|
17
13
|
if req.path == "/ping"
|
18
14
|
return [200, {"Content-Type" => "text/plain"}, ["PONG"]]
|
19
15
|
end
|
20
16
|
|
17
|
+
if @force_rewrite_https && req.get_header("HTTP_X_FORWARDED_PROTO") == "http"
|
18
|
+
return [301, {"Location" => req.url.gsub(/^http/, "https"), "Strict-Transport-Security" => "max-age=31536000"}, []]
|
19
|
+
end
|
20
|
+
|
21
21
|
@app.call(req.env)
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_slb_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xxy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-12-
|
11
|
+
date: 2017-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|