rack-corsgate 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/classes/cors_gate.rb +2 -11
- 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: b1f305b127ff439908cd4dffccf2f139b9011f45
|
4
|
+
data.tar.gz: f732849d3059fc7af1a5cd65c4a17fdd341a22c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f6913eb0ff19b941b5cf84dec0803326f3b8d534f2a9bac5d8783fcfeec0901f448602c36fb64232711710bd37c05528852e3e9d4ef45a1fa9625bd9160fb2b
|
7
|
+
data.tar.gz: 8a9ab883c3aab311bffc8a7974574d65f970ccdebbb17399690274d1fd21e4849d2297ba6032fa4c8090c284b25c8d4952caba2028f4d235e7cc1ef5ef045d4b
|
data/lib/classes/cors_gate.rb
CHANGED
@@ -38,17 +38,8 @@ module Rack
|
|
38
38
|
private
|
39
39
|
|
40
40
|
def is_allowed(env, origin, method)
|
41
|
-
|
42
|
-
if origin.nil?
|
43
|
-
return true unless @strict
|
44
|
-
|
45
|
-
# if strict, but allow_safe we let GET and HEAD through
|
46
|
-
if @allow_safe && ['GET', 'HEAD'].include?(method)
|
47
|
-
return true
|
48
|
-
end
|
49
|
-
return false
|
50
|
-
end
|
51
|
-
|
41
|
+
return true if @allow_safe && ['GET', 'HEAD'].include?(method.upcase)
|
42
|
+
return true if !@strict && origin.nil?
|
52
43
|
env['rack.cors'].hit?
|
53
44
|
end
|
54
45
|
end
|