message_bus 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of message_bus might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/lib/message_bus.rb +3 -6
- data/lib/message_bus/rack/middleware.rb +1 -1
- data/lib/message_bus/version.rb +1 -1
- data/spec/lib/middleware_spec.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f26f77d34d537d666747db10d116e2620239f35
|
4
|
+
data.tar.gz: 1af42d9201dea09f8f533709cad6d4cf3afb7707
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2880b09a9223afbfa3d4ae0b9cfad08ddf9dec05d3f5058930019bf7fefbdaaad3d22b4803dd50ad6fff2a70a736794cfa99f66cfab061adbba3ccbdaedc2892
|
7
|
+
data.tar.gz: 974187d731c56cb02a8c56297737f38d4cbb72b588598d9ad4f9ef19fc65a0955867f0545fc6b160bc3bf0a30ce6155643ec7b46d7b3a7873f8a4ffbf427f808
|
data/CHANGELOG
CHANGED
data/lib/message_bus.rb
CHANGED
@@ -141,12 +141,9 @@ module MessageBus::Implementation
|
|
141
141
|
@is_admin_lookup
|
142
142
|
end
|
143
143
|
|
144
|
-
def
|
145
|
-
@
|
146
|
-
|
147
|
-
|
148
|
-
def access_control_allow_origin
|
149
|
-
@access_control_allow_origin
|
144
|
+
def access_control_allow_origin_lookup(&blk)
|
145
|
+
@access_control_allow_origin_lookup = blk if blk
|
146
|
+
@access_control_allow_origin_lookup
|
150
147
|
end
|
151
148
|
|
152
149
|
def client_filter(channel, &blk)
|
@@ -87,7 +87,7 @@ class MessageBus::Rack::Middleware
|
|
87
87
|
headers = {}
|
88
88
|
headers["Cache-Control"] = "must-revalidate, private, max-age=0"
|
89
89
|
headers["Content-Type"] ="application/json; charset=utf-8"
|
90
|
-
headers["Access-Control-Allow-Origin"] = @bus.
|
90
|
+
headers["Access-Control-Allow-Origin"] = @bus.access_control_allow_origin_lookup.call(env) if @bus.access_control_allow_origin_lookup
|
91
91
|
|
92
92
|
ensure_reactor
|
93
93
|
|
data/lib/message_bus/version.rb
CHANGED
data/spec/lib/middleware_spec.rb
CHANGED
@@ -163,7 +163,9 @@ describe MessageBus::Rack::Middleware do
|
|
163
163
|
end
|
164
164
|
|
165
165
|
it "should include access control headers" do
|
166
|
-
@bus.
|
166
|
+
@bus.access_control_allow_origin_lookup do |env|
|
167
|
+
"http://rainbows.com"
|
168
|
+
end
|
167
169
|
|
168
170
|
client_id = "ABCD"
|
169
171
|
|