rack-access-control-headers 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1 @@
1
+ require 'rack/access-control-headers'
@@ -0,0 +1,18 @@
1
+ module Rack
2
+ class AccessControlHeaders
3
+ def initialize(app, path)
4
+ @app = app
5
+ @path = path
6
+ end
7
+
8
+ def call(env)
9
+ response = @app.call(env)
10
+ if env["PATH_INFO"].match @path
11
+ response[1]["Access-Control-Allow-Origin"] = "*"
12
+ response[1]["Cache-Control"] = "public"
13
+ response[1]["Expires"] = 10.years.from_now.httpdate
14
+ end
15
+ response
16
+ end
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rack-access-control-headers
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 1
9
+ version: 0.0.1
10
+ platform: ruby
11
+ authors:
12
+ - Thomas Pomfret
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2012-05-11 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: Set access control headers for FF
22
+ email:
23
+ - thomas@mintdigital.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - lib/rack-access-control-headers.rb
32
+ - lib/rack/access-control-headers.rb
33
+ has_rdoc: true
34
+ homepage: http://github.com/mintdigital/rack-access-control-headers
35
+ licenses: []
36
+
37
+ post_install_message:
38
+ rdoc_options: []
39
+
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ segments:
48
+ - 0
49
+ version: "0"
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ requirements: []
59
+
60
+ rubyforge_project:
61
+ rubygems_version: 1.3.7
62
+ signing_key:
63
+ specification_version: 3
64
+ summary: Sends headers to allow FF to show font files cross-domain
65
+ test_files: []
66
+