Skip to content

Commit

Permalink
word
Browse files Browse the repository at this point in the history
  • Loading branch information
tanfarming committed Nov 22, 2023
1 parent 0b14c1b commit 49986e1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/ret_web/controllers/page_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,7 @@ defmodule RetWeb.PageController do
[:scheme, :port, :host] |> Enum.map(&Keyword.get(cors_proxy_url, &1))

is_cors_proxy_url =
if System.get_env("TURKEY_MODE") do
IO.puts(cors_host, conn.host, compare_hosts(cors_host, conn.host) )
IO.puts(cors_scheme, get_req_header(conn, "x-forwarded-proto") |> Enum.at(0) )

if System.get_env("TURKEY_MODE") do
compare_hosts(conn.host, cors_host) &&
cors_scheme == get_req_header(conn, "x-forwarded-proto") |> Enum.at(0)

Expand Down Expand Up @@ -741,9 +738,6 @@ defmodule RetWeb.PageController do
end

def compare_hosts(host1, host2) do
IO.puts("host1: #{host1}, host2: #{host2}")
IO.puts(String.split(host1, ".", parts: -1) |> Enum.slice(0..-2) |> Enum.join("."))
IO.puts(String.split(host2, ".", parts: -1) |> Enum.slice(0..-2) |> Enum.join("."))
host1 == host2 ||
(host2 |> String.split(".") |> List.last()) == "dev"
&& host1 |> String.split(".") |> Enum.slice(0..-2) == host2 |> String.split(".") |> Enum.slice(0..-2)
Expand Down

0 comments on commit 49986e1

Please sign in to comment.