rack-cors 1.0.2 → 2.0.2

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.
@@ -1,8 +0,0 @@
1
- require 'rack/cors'
2
-
3
- use Rack::Cors do
4
- allow do
5
- origins 'com.company.app'
6
- resource '/public'
7
- end
8
- end
data/test/unit/test.ru DELETED
@@ -1,60 +0,0 @@
1
- require 'rack/cors'
2
-
3
- #use Rack::Cors, :debug => true, :logger => ::Logger.new(STDOUT) do
4
- use Rack::Lint
5
- use Rack::Cors do
6
- allow do
7
- origins 'localhost:3000',
8
- '127.0.0.1:3000',
9
- /http:\/\/192\.168\.0\.\d{1,3}(:\d+)?/,
10
- 'file://',
11
- /http:\/\/(.*?)\.example\.com/
12
-
13
- resource '/get-only', :methods => :get
14
- resource '/', :headers => :any, :methods => :any
15
- resource '/options', :methods => :options
16
- resource '/single_header', :headers => 'x-domain-token'
17
- resource '/two_headers', :headers => %w{x-domain-token x-requested-with}
18
- resource '/expose_single_header', :expose => 'expose-test'
19
- resource '/expose_multiple_headers', :expose => %w{expose-test-1 expose-test-2}
20
- resource '/conditional', :methods => :get, :if => proc { |env| !!env['HTTP_X_OK'] }
21
- resource '/vary_test', :methods => :get, :vary => %w{ Origin Host }
22
- # resource '/file/at/*',
23
- # :methods => [:get, :post, :put, :delete],
24
- # :headers => :any,
25
- # :max_age => 0
26
- end
27
-
28
- allow do
29
- origins do |source,env|
30
- source.end_with?("10.10.10.10:3000")
31
- end
32
- resource '/proc-origin'
33
- end
34
-
35
- allow do
36
- origins -> (source, env) { source.end_with?("10.10.10.10:3000") }
37
- resource '/lambda-origin'
38
- end
39
-
40
- allow do
41
- origins '*'
42
- resource '/public'
43
- resource '/public_without_credentials', :credentials => false
44
- end
45
-
46
- allow do
47
- origins 'mucho-grande.com'
48
- resource '/multi-allow-config', :max_age => 600
49
- end
50
-
51
- allow do
52
- origins '*'
53
- resource '/multi-allow-config', :max_age => 300, :credentials => false
54
- end
55
-
56
- allow do
57
- origins ''
58
- resource '/blank-origin'
59
- end
60
- end