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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98127852a5b1deb4d65c1c71c8ec9e048caf2ce22910663dd5c6ee85b6722d36
4
- data.tar.gz: 0a1dd3d440b7473bc1f53122e53c6fb8f0adb56e6917908f082a588b2a36c43d
3
+ metadata.gz: 3a73c8637d0b96e431013d01632f70c244c99c4b4e7208ef9c5898f7e951fe06
4
+ data.tar.gz: 1e54fd422cbf593dec4f3aea10c4c0f9508928023ebaf7381ee6c6a7ba9db19b
5
5
  SHA512:
6
- metadata.gz: a04011921ea3bfe3570ebb322d1a4d81a9e106f2afb3f9cf4a0b98a4e424eceee219d3d95706582dc934d6415b4c934610c146759792f0819c77325d5611f960
7
- data.tar.gz: 5fdce0b692c9d38b4e61659c53971811cb79e846fe704d259b52ae33670ae1e13248a909bd84679f7b1c00992bf69f1d03acfb469fa1508606a1d7aa1e06e286
6
+ metadata.gz: 1b1dccf8d66476f1861657e1536a065c2a704210c9905620cc40d364d368f105cb4d70d7c6fba097d3c044350c43e3bf06ebf24d93c6207cc4797e581fe024fe
7
+ data.tar.gz: 9168807c31dd2156b255f0e8057294b4a75e09cb717a128db1ba0411399780c16854c8f3d27a6472ff5b945b1704d32509ee63f9345149195f4071850142e4aa
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Roda
4
4
  module Proxy
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.2'
6
6
  end
7
7
  end
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' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas