sq_auth 0.0.22 → 0.0.23
Sign up to get free protection for your applications and to get access to all the features.
@@ -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
|
-
|
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)
|
data/lib/sq_auth/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2012-05-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|