startback 0.15.0 → 0.15.1

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: d3b72151f15267aa20de6185a0f6c33d6ee22370171dfb34574604dfb1c5016c
4
- data.tar.gz: 2aa005e7ca84a6dab18a29b0054ad16483b5c8b27e789351c8dfb3bccdc4714a
3
+ metadata.gz: aedecb0daf2771549cdede97feba4f0b95255b4e073e57f6f8aed834de45c7ea
4
+ data.tar.gz: 93238106d46190b9c8347040e7e155b79a11296ad0377e722d749d53fa1a156d
5
5
  SHA512:
6
- metadata.gz: fb5b6cb84aa0fb74ad5600fd5cefaf7efc1bd0bd659555e5035031db98646d7cf44f66c22c1c04ffa020d74dbdb4ad4609e09a8dda2efee7b0f41570a0ce57ae
7
- data.tar.gz: ebacc25e2ca8628d5914396314bec03a22d65fa39886656f2f0863fb02efc1276cda9ccf07e1ef0256489ad17845e5e3fb224c4707ce4295740917af872b240f
6
+ metadata.gz: b0295a08c94dc01fc6bcb0aeaa61e33c9306ec89614da443d38544c524a4772fab565cded8f69b6fb02b8101139be89283309fc488326cf1a500627683b2a65a
7
+ data.tar.gz: 9254603245c14c4f3a4dc66c0113d5a25605c99f570ef2e33c14fe59c1006251122f87ceba19a8072ee8689a605b181cf453e78ca2e508838403d4e22696acc4
@@ -2,7 +2,7 @@ module Startback
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 15
5
- TINY = 0
5
+ TINY = 1
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -72,8 +72,11 @@ module Startback
72
72
 
73
73
  def cors_headers(origin)
74
74
  headers = @options[:headers].dup
75
- bounce = do_bounce(origin)
76
- headers['Access-Control-Allow-Origin'] = bounce
75
+ if bounce = do_bounce(origin)
76
+ headers['Access-Control-Allow-Origin'] = bounce
77
+ else
78
+ headers.delete('Access-Control-Allow-Origin')
79
+ end
77
80
  headers
78
81
  end
79
82
 
@@ -95,6 +95,7 @@ module Startback
95
95
  it 'rejects otherwise' do
96
96
  header('Origin', "https://nosuchone.com")
97
97
  get '/'
98
+ expect(last_response.headers.key?('Access-Control-Allow-Origin')).to eql(false)
98
99
  expect(last_response['Access-Control-Allow-Origin']).to be_nil
99
100
  end
100
101
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: startback
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau