From 823dfefef077829e4a4499cfe664d6c0376882d2 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 11 Aug 2024 13:58:55 -0400 Subject: [PATCH] 0.8.4: I was drunk sorry --- src/routing.cr | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/routing.cr b/src/routing.cr index 47819ea..a88f3cc 100644 --- a/src/routing.cr +++ b/src/routing.cr @@ -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