rack-cors 0.1.0 → 0.1.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.
Potentially problematic release.
This version of rack-cors might be problematic. Click here for more details.
- data/.gitignore +1 -0
- data/README.rdoc +32 -0
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/rack-cors.gemspec +41 -0
- metadata +13 -5
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
pkg
|
data/README.rdoc
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
= Rack CORS Middleware
|
2
|
+
|
3
|
+
Rack::Cors provides support for Cross-Origin Resource Sharing (CORS) for Rack compatible web applications. The CORS spec allows web applications to make cross domain AJAX calls without
|
4
|
+
using workarounds such as JSONP. For a thorough write up on CORS, see this blog post:
|
5
|
+
|
6
|
+
http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/
|
7
|
+
|
8
|
+
Or for all the gory details, you can read the spec here:
|
9
|
+
|
10
|
+
http://www.w3.org/TR/access-control/#simple-cross-origin-request-and-actual-r
|
11
|
+
|
12
|
+
|
13
|
+
Install the gem:
|
14
|
+
|
15
|
+
gem install rack-cors
|
16
|
+
|
17
|
+
|
18
|
+
== Configuration
|
19
|
+
|
20
|
+
You configure Rack::Cors by passing a block to the <tt>use</tt> command:
|
21
|
+
|
22
|
+
use Rack::Cors do |config|
|
23
|
+
config.allow do |allow|
|
24
|
+
allow.origins 'localhost:3000', '127.0.0.1:3000'
|
25
|
+
|
26
|
+
allow.resource '/file/list_all/', :headers => 'x-domain-token'
|
27
|
+
|
28
|
+
allow.resource '/file/at/*',
|
29
|
+
:methods => [:get, :post, :put, :delete],
|
30
|
+
:headers => 'x-domain-token'
|
31
|
+
end
|
32
|
+
end
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/rack-cors.gemspec
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{rack-cors}
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Calvin Yu"]
|
12
|
+
s.date = %q{2010-06-02}
|
13
|
+
s.email = %q{csyu77@gmail.com}
|
14
|
+
s.extra_rdoc_files = [
|
15
|
+
"README.rdoc"
|
16
|
+
]
|
17
|
+
s.files = [
|
18
|
+
".gitignore",
|
19
|
+
"README.rdoc",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"lib/rack/cors.rb",
|
23
|
+
"rack-cors.gemspec"
|
24
|
+
]
|
25
|
+
s.homepage = %q{http://github.com/cyu/rack-cors}
|
26
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
27
|
+
s.require_paths = ["lib"]
|
28
|
+
s.rubygems_version = %q{1.3.7}
|
29
|
+
s.summary = %q{Middleware for enabling Cross-Origin Resource Sharing in Rack apps}
|
30
|
+
|
31
|
+
if s.respond_to? :specification_version then
|
32
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
33
|
+
s.specification_version = 3
|
34
|
+
|
35
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
36
|
+
else
|
37
|
+
end
|
38
|
+
else
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-cors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Calvin Yu
|
@@ -24,12 +25,15 @@ executables: []
|
|
24
25
|
|
25
26
|
extensions: []
|
26
27
|
|
27
|
-
extra_rdoc_files:
|
28
|
-
|
28
|
+
extra_rdoc_files:
|
29
|
+
- README.rdoc
|
29
30
|
files:
|
31
|
+
- .gitignore
|
32
|
+
- README.rdoc
|
30
33
|
- Rakefile
|
31
34
|
- VERSION
|
32
35
|
- lib/rack/cors.rb
|
36
|
+
- rack-cors.gemspec
|
33
37
|
has_rdoc: true
|
34
38
|
homepage: http://github.com/cyu/rack-cors
|
35
39
|
licenses: []
|
@@ -40,23 +44,27 @@ rdoc_options:
|
|
40
44
|
require_paths:
|
41
45
|
- lib
|
42
46
|
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
43
48
|
requirements:
|
44
49
|
- - ">="
|
45
50
|
- !ruby/object:Gem::Version
|
51
|
+
hash: 3
|
46
52
|
segments:
|
47
53
|
- 0
|
48
54
|
version: "0"
|
49
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
50
57
|
requirements:
|
51
58
|
- - ">="
|
52
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
53
61
|
segments:
|
54
62
|
- 0
|
55
63
|
version: "0"
|
56
64
|
requirements: []
|
57
65
|
|
58
66
|
rubyforge_project:
|
59
|
-
rubygems_version: 1.3.
|
67
|
+
rubygems_version: 1.3.7
|
60
68
|
signing_key:
|
61
69
|
specification_version: 3
|
62
70
|
summary: Middleware for enabling Cross-Origin Resource Sharing in Rack apps
|