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 +4 -4
- data/lib/startback/version.rb +1 -1
- data/lib/startback/web/cors_headers.rb +5 -2
- data/spec/unit/web/test_cors_headers.rb +1 -0
- 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: aedecb0daf2771549cdede97feba4f0b95255b4e073e57f6f8aed834de45c7ea
|
4
|
+
data.tar.gz: 93238106d46190b9c8347040e7e155b79a11296ad0377e722d749d53fa1a156d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0295a08c94dc01fc6bcb0aeaa61e33c9306ec89614da443d38544c524a4772fab565cded8f69b6fb02b8101139be89283309fc488326cf1a500627683b2a65a
|
7
|
+
data.tar.gz: 9254603245c14c4f3a4dc66c0113d5a25605c99f570ef2e33c14fe59c1006251122f87ceba19a8072ee8689a605b181cf453e78ca2e508838403d4e22696acc4
|
data/lib/startback/version.rb
CHANGED
@@ -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
|
-
|
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
|