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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e700c3c80050d48c9178c002eff99ffc42e93ea
4
- data.tar.gz: 1397d55bf69953ac861e8dc36bc217958daeab20
3
+ metadata.gz: 0f26f77d34d537d666747db10d116e2620239f35
4
+ data.tar.gz: 1af42d9201dea09f8f533709cad6d4cf3afb7707
5
5
  SHA512:
6
- metadata.gz: dac0e42ad4de5e15c56b8906c98cf55448bffbc5e5ea15615cbbb0c37d231cf423b79fab5130717e94900aa0777924ed8277db7a5b14dfc2e55ca581069d60a8
7
- data.tar.gz: 1688685a11b6f70b027064ad97ea2a220a97ca424d1294fe379ef75a009793e7a7079c7e217a22ea9853ecfa7c4832e0f8f24a632d858db87380558ce39f241b
6
+ metadata.gz: 2880b09a9223afbfa3d4ae0b9cfad08ddf9dec05d3f5058930019bf7fefbdaaad3d22b4803dd50ad6fff2a70a736794cfa99f66cfab061adbba3ccbdaedc2892
7
+ data.tar.gz: 974187d731c56cb02a8c56297737f38d4cbb72b588598d9ad4f9ef19fc65a0955867f0545fc6b160bc3bf0a30ce6155643ec7b46d7b3a7873f8a4ffbf427f808
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ 23-09-2014
2
+ - Version 1.0.3
3
+ - Change: MessageBus.access_control_allow_origin to MessageBus.access_control_allow_origin_lookup
4
+
1
5
  23-09-2014
2
6
  - Version 1.0.2
3
7
  - Feature: MessageBus.access_control_allow_origin to control origin header
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 access_control_allow_origin=(origin)
145
- @access_control_allow_origin = origin
146
- end
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.access_control_allow_origin if @bus.access_control_allow_origin
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
 
@@ -1,3 +1,3 @@
1
1
  module MessageBus
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -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.access_control_allow_origin = "http://rainbows.com"
166
+ @bus.access_control_allow_origin_lookup do |env|
167
+ "http://rainbows.com"
168
+ end
167
169
 
168
170
  client_id = "ABCD"
169
171
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: message_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron