rack-access-control-headers 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/access-control-headers.rb +3 -2
- metadata +4 -6
@@ -1,14 +1,15 @@
|
|
1
1
|
module Rack
|
2
2
|
class AccessControlHeaders
|
3
|
-
def initialize(app, path)
|
3
|
+
def initialize(app, path, origin = "*")
|
4
4
|
@app = app
|
5
5
|
@path = path
|
6
|
+
@origin = origin
|
6
7
|
end
|
7
8
|
|
8
9
|
def call(env)
|
9
10
|
response = @app.call(env)
|
10
11
|
if env["PATH_INFO"].match @path
|
11
|
-
response[1]["Access-Control-Allow-Origin"] =
|
12
|
+
response[1]["Access-Control-Allow-Origin"] = @origin
|
12
13
|
response[1]["Cache-Control"] = "public"
|
13
14
|
response[1]["Expires"] = 10.years.from_now.httpdate
|
14
15
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Thomas Pomfret
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-05-
|
17
|
+
date: 2012-05-14 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -40,7 +40,6 @@ rdoc_options: []
|
|
40
40
|
require_paths:
|
41
41
|
- lib
|
42
42
|
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
@@ -48,7 +47,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
47
|
- 0
|
49
48
|
version: "0"
|
50
49
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
-
none: false
|
52
50
|
requirements:
|
53
51
|
- - ">="
|
54
52
|
- !ruby/object:Gem::Version
|
@@ -58,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
56
|
requirements: []
|
59
57
|
|
60
58
|
rubyforge_project:
|
61
|
-
rubygems_version: 1.3.
|
59
|
+
rubygems_version: 1.3.6
|
62
60
|
signing_key:
|
63
61
|
specification_version: 3
|
64
62
|
summary: Sends headers to allow FF to show font files cross-domain
|