api_valve 0.7.5 → 0.8.0

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
  SHA256:
3
- metadata.gz: a1e423a6ca2aa1d4c6bc6e5e8f5a08a8bd038b82b5f04900b9a5b6d8c284c3e6
4
- data.tar.gz: 0d663952c1afcbc94a2ef45820180d7b678986d625af0c1573636187612d16d3
3
+ metadata.gz: 0077e2b67d1a99fcde84633c66f4bb2eb6cbd9b65e45b46a1bbc6f22f0a7bf47
4
+ data.tar.gz: e880e13b437165fa6678638fa7e8a632115a7587bf9024fdf86f81399c12ac75
5
5
  SHA512:
6
- metadata.gz: c8d833a39d15bf5c1d4158148de31a7ac06dac5c9cf76efff652a2aaade2491756c9853f1ef84a6f7d40e6d27c8be80683352a08abffafc6db0c59ad3c827175
7
- data.tar.gz: 8e1a25c63606dfe78672ef418f4a419556afccbf770aa4c543e11253f612b8f2d31a0af0feab769a315a8e072076a6dca56319d058e58c6f56fbc4f35039ad1e
6
+ metadata.gz: 5802ab4c218221aabbb6921337165090911137ca5d42e66551706e7ab99cd0e9fe69000246ecbdf733605ae8b1bbab3aa8bc5b812786e6ba2450adeeb327fb25
7
+ data.tar.gz: d7e2f3dbe1b9fb27e2db8a5444adf05abb044dd6e5947fa8ecb0f729091bd2e96f24daf154f810333c4286feee99424a45a2cedd76831174386e3bb922abd00d
data/README.md CHANGED
@@ -18,3 +18,21 @@ gem 'api_valve'
18
18
 
19
19
  See the [examples](https://github.com/mkon/api_valve/tree/master/examples) section on how to
20
20
  create & configure your own proxy using this gem.
21
+
22
+ ### Headers
23
+
24
+ By default the following headers are forwarded:
25
+
26
+ * `Accept`
27
+ * `Content-Type`
28
+ * `User-Agent`
29
+ * `X-Real-IP`
30
+ * `X-Request-Id`
31
+
32
+ Additionally these headers are generated:
33
+
34
+ * `X-Forwarded-For`: The ApiGateway is added to the list
35
+ * `X-Forwarded-Host`: Filled with original request host
36
+ * `X-Forwarded-Port`: Filled with original request port
37
+ * `X-Forwarded-Prefix`: Filled with the path prefix of the forwarder within the Api Gateway (eg `SCRIPT_NAME` env)
38
+ * `X-Forwarded-Proto`: Filled with original request scheme
@@ -76,11 +76,12 @@ module ApiValve
76
76
 
77
77
  def forwarded_headers
78
78
  {
79
- 'X-Forwarded-For' => x_forwarded_for,
80
- 'X-Forwarded-Host' => original_request.host,
81
- 'X-Forwarded-Port' => original_request.port.to_s,
82
- 'X-Forwarded-Proto' => original_request.scheme
83
- }
79
+ 'X-Forwarded-For' => x_forwarded_for,
80
+ 'X-Forwarded-Host' => original_request.host,
81
+ 'X-Forwarded-Port' => original_request.port.to_s,
82
+ 'X-Forwarded-Prefix' => original_request.env['SCRIPT_NAME'].presence,
83
+ 'X-Forwarded-Proto' => original_request.scheme
84
+ }.compact
84
85
  end
85
86
 
86
87
  def override_path(options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_valve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mkon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-05 00:00:00.000000000 Z
11
+ date: 2020-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport