bowtie-io 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bowtie/middleware/proxy.rb +27 -1
- data/lib/bowtie/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76ff84184ca2e50f02a42c5dc8cfe8f161dc6eee
|
4
|
+
data.tar.gz: 288772ac304aea183f0c6c95be6adea13def9040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abca3ab762ce01164ba01f5eb76fc0c3e032b66ba4e031971a4561f9bf546f86827eddaf9d6e350deaae650c9f48e320c8d770b4afd0b8a8aea9358e92c2d2d4
|
7
|
+
data.tar.gz: 1090e2fec10c582df360349e5c679d2dc8d5c7c5aae896f50fd7a249d2448db0612dbf150aa16ea47d5b3dea758a76e845417ae9fa290e66bcf092742f26c384
|
@@ -1,5 +1,31 @@
|
|
1
1
|
module Bowtie::Middleware
|
2
|
-
class Proxy
|
2
|
+
class Proxy
|
3
|
+
def initialize(*args)
|
4
|
+
@platform = Platform.new(*args)
|
5
|
+
@backend = Backend.new(*args)
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(env)
|
9
|
+
status, headers, body = @platform.call(env)
|
10
|
+
|
11
|
+
if status.to_i == 305
|
12
|
+
env[:proxy_addon_headers] = JSON.load(headers['X-Bowtie-Client-Proxy-Headers'])
|
13
|
+
env[:proxy_location] = headers['Location']
|
14
|
+
@backend.call(env)
|
15
|
+
else
|
16
|
+
[status, headers, body]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
class Backend < Rack::StreamingProxy::Proxy
|
23
|
+
def destination_uri(rack_request)
|
24
|
+
rack_request.env[:proxy_location]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class Platform < Rack::StreamingProxy::Proxy
|
3
29
|
def destination_uri(rack_request)
|
4
30
|
fqdn = Bowtie::Settings['project']['fqdn']['development']
|
5
31
|
base_url = "https://#{fqdn}"
|
data/lib/bowtie/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowtie-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kassemi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|