et_gds_design_system 5.0.1 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/et_gds_design_system/api_proxy.rb +4 -8
- data/lib/et_gds_design_system/version.rb +1 -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: dbc8799c7ee39d4789978e1364102f7b4d43be7b1855eff08d59ad1af431eb18
|
|
4
|
+
data.tar.gz: 4cbcfc5505278342807a4761cfc6fed8deb58b3d7aa388bd690adacf1ec8783c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b21525a53691c065fdad9f4f1a04f5b78ee263e42f3aeddd03a24b05ca55e541f73b2ae05a663d9609a6087ea897e7f80d71b3bbce496a0cd5301a31a23464f
|
|
7
|
+
data.tar.gz: 32a4b05ebb827cb9273d070310ced1492e4783de9edbfd4b459df23f90c3527feeaaa860e0e7c1d67b4128961e50bc8d479711ae5046b09fe6494ecc957a9b54
|
|
@@ -3,21 +3,17 @@ require 'rack-proxy'
|
|
|
3
3
|
module EtGdsDesignSystem
|
|
4
4
|
class ApiProxy < Rack::Proxy
|
|
5
5
|
def rewrite_env(env)
|
|
6
|
-
env.merge 'REQUEST_URI' =>
|
|
6
|
+
env.merge 'REQUEST_URI' => modified_url_for(env),
|
|
7
7
|
'HTTP_HOST' => "#{et_api_uri.host}:#{et_api_uri.port}",
|
|
8
8
|
'PATH_INFO' => ''
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
private
|
|
12
12
|
|
|
13
|
-
def
|
|
14
|
-
uri =
|
|
15
|
-
uri.
|
|
16
|
-
uri.host = et_api_uri.host
|
|
17
|
-
uri.port = et_api_uri.port
|
|
13
|
+
def modified_url_for(env)
|
|
14
|
+
uri = et_api_uri.clone
|
|
15
|
+
uri.path = env['REQUEST_PATH']
|
|
18
16
|
uri.to_s
|
|
19
|
-
rescue URI::InvalidURIError
|
|
20
|
-
raise "Invalid URL - '#{url}'"
|
|
21
17
|
end
|
|
22
18
|
|
|
23
19
|
def et_api_uri
|