0.8.4: I was drunk sorry

This commit is contained in:
Fijxu 2024-08-11 13:58:55 -04:00
parent ede4cb896c
commit 823dfefef0
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -17,9 +17,8 @@ module Routing
end
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
if ip_address.includes?(ip_address)
# TODO: Custom halt function to return a JSON
halt env, status_code: 401, response: CONFIG.torMessage
if @@exit_nodes.includes?(ip_address)
halt env, status_code: 401, response: error401(CONFIG.torMessage)
end
end
end