charcoal 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7622da23541be07303b649835824b230e39533a
4
- data.tar.gz: d483edf4d2f4a76e590cdd7c5e0fb71dd3b809fa
3
+ metadata.gz: 257a79e961264afcc25572a670f923de1cd23d8d
4
+ data.tar.gz: 44acf3c34baf250bd418a657870c9c11448d4a00
5
5
  SHA512:
6
- metadata.gz: 12e4efbd993a3ca883123a61266d9e726a3516f48451dc589177f3a3b41dcbd54eb5230cdb9424043f0f48660c0a2e4179b29dd352472fbc90c373f4af1bc279
7
- data.tar.gz: b136b61fad42a87a3b391529eadf38b328a2f54adc1df2a1386f39f9a07d323a75dbc6459914fdf987eaa2c389ab9ec4c6e5177fcddfc57bd9cd3a4a7ee4a583
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.after_filter :set_cors_headers, :if => :cors_allowed?
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
- skip_after_filter :set_cors_headers
13
+ skip_around_filter :set_cors_headers_filter
14
14
 
15
15
  # OPTIONS *
16
16
  def preflight
@@ -1,3 +1,3 @@
1
1
  module Charcoal
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
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.0.0
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-23 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport