roda-proxy 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/roda/proxy/version.rb +1 -1
- data/lib/roda/proxy.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a73c8637d0b96e431013d01632f70c244c99c4b4e7208ef9c5898f7e951fe06
|
4
|
+
data.tar.gz: 1e54fd422cbf593dec4f3aea10c4c0f9508928023ebaf7381ee6c6a7ba9db19b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b1dccf8d66476f1861657e1536a065c2a704210c9905620cc40d364d368f105cb4d70d7c6fba097d3c044350c43e3bf06ebf24d93c6207cc4797e581fe024fe
|
7
|
+
data.tar.gz: 9168807c31dd2156b255f0e8057294b4a75e09cb717a128db1ba0411399780c16854c8f3d27a6472ff5b945b1704d32509ee63f9345149195f4071850142e4aa
|
data/lib/roda/proxy/version.rb
CHANGED
data/lib/roda/proxy.rb
CHANGED
@@ -37,6 +37,7 @@ class Roda
|
|
37
37
|
def proxy
|
38
38
|
method = Faraday.method(env['REQUEST_METHOD'].downcase.to_sym)
|
39
39
|
f_response = method.call(_proxy_url) { |req| _proxy_request(req) }
|
40
|
+
pp f_response
|
40
41
|
_respond(f_response)
|
41
42
|
end
|
42
43
|
|
@@ -65,11 +66,13 @@ class Roda
|
|
65
66
|
|
66
67
|
def _proxy_url
|
67
68
|
@_proxy_url ||= URI(roda_class.opts[:proxy_to])
|
68
|
-
.then { |uri| uri.path = roda_class.opts[:proxy_path]; uri }
|
69
|
+
.then { |uri| uri.path = roda_class.opts[:proxy_path]; uri } # prefix
|
70
|
+
.then { |uri| uri.path += env['PATH_INFO'][1..-1]; uri } # path
|
69
71
|
.then { |uri| uri.query = env['QUERY_STRING']; uri }
|
70
72
|
end
|
71
73
|
|
72
74
|
def _proxy_headers
|
75
|
+
pp env
|
73
76
|
env
|
74
77
|
.select { |k, _v| k.start_with? 'HTTP_' }
|
75
78
|
.reject { |k, _v| k == 'HTTP_HOST' }
|