0.8.4: I was drunk sorry
This commit is contained in:
parent
ede4cb896c
commit
823dfefef0
1 changed files with 2 additions and 3 deletions
|
@ -17,9 +17,8 @@ module Routing
|
||||||
end
|
end
|
||||||
before_post do |env|
|
before_post do |env|
|
||||||
ip_address = env.request.headers.try &.["X-Forwarded-For"]? ? env.request.headers.["X-Forwarded-For"] : env.request.remote_address.to_s.split(":").first
|
ip_address = env.request.headers.try &.["X-Forwarded-For"]? ? env.request.headers.["X-Forwarded-For"] : env.request.remote_address.to_s.split(":").first
|
||||||
if ip_address.includes?(ip_address)
|
if @@exit_nodes.includes?(ip_address)
|
||||||
# TODO: Custom halt function to return a JSON
|
halt env, status_code: 401, response: error401(CONFIG.torMessage)
|
||||||
halt env, status_code: 401, response: CONFIG.torMessage
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue