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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1cc5768ef62cea84f54c55ca3d108bd30de9c13
4
- data.tar.gz: 90ef39f1da80b17ff208893f7af3bcb7d86a72ca
3
+ metadata.gz: acd0236a988d2aa8e6c2e8f98d333671bac08462
4
+ data.tar.gz: 05a9b3890dd67f6d32892fbf661edc97c1260a72
5
5
  SHA512:
6
- metadata.gz: 4d816278ac5caf629bf5f012bffb0a04d52bb9722d044fe5fb8a49dc1bcf2081b5f98a4793ef72b87f833393a1eb886d0238c580a8c3f1b6674ebf0f59909427
7
- data.tar.gz: 1462dad53efb9775c92dd4b5cb7d98943a7c9431593f709439c8cfc23be2c804e4d31219326ec9434891433c6495ba159bbbdee0a99958e89e5cb365d3ec23dc
6
+ metadata.gz: ef5610d161ff14f202516d30dfab6c0f7a3083a3e07e47e88fc65b80baf067b15c143745211d67c4c146f4fbd0c8a5677d20b99658a551835c196ce1351f477f
7
+ data.tar.gz: 0646c645d46c0cd618e22019dec5b58adaa897a206fcb3e60f4f3e2b4a04d3f7b33e8c87238a755d20efcff5f4bf6b5a9307ffd1e36f0393262b2e00ef089301
data/.gitignore CHANGED
@@ -6,4 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- rails_slb_middleware-0.1.0.gem
9
+ *.gem
@@ -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
@@ -1,3 +1,3 @@
1
1
  class RailsSlbMiddleware
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  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.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-01 00:00:00.000000000 Z
11
+ date: 2017-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack