From 8a399ffe5d0a1621d084b9a46449be32aa6ed52c Mon Sep 17 00:00:00 2001 From: tanfarming Date: Wed, 22 Nov 2023 12:02:41 -0500 Subject: [PATCH] word --- lib/ret_web/controllers/page_controller.ex | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ret_web/controllers/page_controller.ex b/lib/ret_web/controllers/page_controller.ex index 50903288d..89c9b39bf 100644 --- a/lib/ret_web/controllers/page_controller.ex +++ b/lib/ret_web/controllers/page_controller.ex @@ -674,8 +674,15 @@ defmodule RetWeb.PageController do resolved_ip = HttpUtils.resolve_ip(host) + IO.inspect(resolved_ip) + IO.inspect(System.get_env("TURKEY_MODE")) + IO.inspect(cors_host) + IO.inspect(conn.host) + IO.inspect(cors_scheme) + IO.inspect(get_req_header(conn, "x-forwarded-proto")) + if HttpUtils.internal_ip?(resolved_ip) do - conn |> send_resp(401, "Bad request.") + conn |> send_resp(401, "Bad request") else # We want to ensure that the URL we request hits the same IP that we verified above, # so we replace the host with the IP address here and use this url to make the proxy request.