sq_auth 0.0.22 → 0.0.23

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.
@@ -8,13 +8,14 @@ module SqAuth
8
8
 
9
9
  def self.alter_environment options={}
10
10
  # Sorry, Konstantin
11
+ protection_module = Rack::Protection::RemoteToken
11
12
  except_host = options[:host]
12
- Rack::Protection::RemoteToken.class_exec(except_host) do |except|
13
- const_set("HOST", except)
13
+ protection_module.class_exec(except_host) do |except|
14
+ protection_module.const_set("HOST", except)
14
15
  alias :old_accepts? :accepts?
15
16
  def accepts?(env)
16
17
  form_hash = Rack::Request.new(env).params
17
- if referrer(env) == HOST && env["REQUEST_METHOD"] == "POST" && form_hash.keys.include?("sqauthsession")
18
+ if referrer(env) == protection_module::HOST && env["REQUEST_METHOD"] == "POST" && form_hash.keys.include?("sqauthsession")
18
19
  true
19
20
  else
20
21
  old_accepts?(env)
@@ -1,3 +1,3 @@
1
1
  module SqAuth
2
- VERSION = "0.0.22"
2
+ VERSION = "0.0.23"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sq_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-02 00:00:00.000000000Z
12
+ date: 2012-05-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake