charcoal 2.0.0 → 2.1.0
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/charcoal/cross_origin.rb +7 -1
- data/lib/charcoal/cross_origin_controller.rb +1 -1
- data/lib/charcoal/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 257a79e961264afcc25572a670f923de1cd23d8d
|
|
4
|
+
data.tar.gz: 44acf3c34baf250bd418a657870c9c11448d4a00
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf9d1b46a477ed166559db85575d6b586d4369d4d47db0c8ac1844526cf4898c30356644e269990749510f3d56697de0cfd1e4229756da5df9fd7bd226c679c8
|
|
7
|
+
data.tar.gz: 899221ade18086627484ad80a6b15653509137b69b1b4302bf109189554fff273224b1727b4414e29e70bca0eedbf10264a6bb9612610cb3c600c27760b58937
|
|
@@ -4,7 +4,7 @@ module Charcoal
|
|
|
4
4
|
module CrossOrigin
|
|
5
5
|
def self.included(klass)
|
|
6
6
|
klass.extend(ClassMethods)
|
|
7
|
-
klass.
|
|
7
|
+
klass.around_filter :set_cors_headers_filter, :if => :cors_allowed?
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
module ClassMethods
|
|
@@ -30,6 +30,12 @@ module Charcoal
|
|
|
30
30
|
self.class.cors_allowed?(self, params[:action])
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
def set_cors_headers_filter
|
|
34
|
+
yield
|
|
35
|
+
ensure
|
|
36
|
+
set_cors_headers
|
|
37
|
+
end
|
|
38
|
+
|
|
33
39
|
def set_cors_headers
|
|
34
40
|
headers["Access-Control-Allow-Origin"] = allowed_origin
|
|
35
41
|
headers["Access-Control-Allow-Credentials"] = Charcoal.configuration["credentials"].to_s
|
|
@@ -10,7 +10,7 @@ class Charcoal::CrossOriginController < ActionController::Base
|
|
|
10
10
|
Routing = defined?(ActionDispatch) ? ActionDispatch::Routing : ActionController::Routing
|
|
11
11
|
|
|
12
12
|
allow_cors :all
|
|
13
|
-
|
|
13
|
+
skip_around_filter :set_cors_headers_filter
|
|
14
14
|
|
|
15
15
|
# OPTIONS *
|
|
16
16
|
def preflight
|
data/lib/charcoal/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: charcoal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steven Davidovitz
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-12-
|
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|