sq_auth 0.0.23 → 0.0.24
Sign up to get free protection for your applications and to get access to all the features.
@@ -8,14 +8,13 @@ module SqAuth
|
|
8
8
|
|
9
9
|
def self.alter_environment options={}
|
10
10
|
# Sorry, Konstantin
|
11
|
-
protection_module = Rack::Protection::RemoteToken
|
12
11
|
except_host = options[:host]
|
13
|
-
|
14
|
-
|
12
|
+
Rack::Protection::RemoteToken.class_exec(except_host) do |except|
|
13
|
+
Rack::Protection::RemoteToken.const_set("HOST", except)
|
15
14
|
alias :old_accepts? :accepts?
|
16
15
|
def accepts?(env)
|
17
16
|
form_hash = Rack::Request.new(env).params
|
18
|
-
if referrer(env) ==
|
17
|
+
if referrer(env) == Rack::Protection::RemoteToken::HOST && env["REQUEST_METHOD"] == "POST" && form_hash.keys.include?("sqauthsession")
|
19
18
|
true
|
20
19
|
else
|
21
20
|
old_accepts?(env)
|
data/lib/sq_auth/version.rb
CHANGED