Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Adjust tests
Uku Taht7e772151e365
diff --git a/lib/plausible_web/controllers/api/external_controller.ex b/lib/plausible_web/controllers/api/external_controller.exindex eda4002ca3..394371e3ce 100644--- a/lib/plausible_web/controllers/api/external_controller.ex+++ b/lib/plausible_web/controllers/api/external_controller.ex@@ -175,10 +175,9 @@ defmodule PlausibleWeb.Api.ExternalController doresult =PlausibleWeb.RemoteIp.get(conn)|> Geolix.lookup()- |> Map.get(:country)- if result && result.country do- result.country.iso_code+ if result && result[:country] && result[:country].country do+ result[:country].country.iso_codeendenddiff --git a/test/plausible_web/controllers/api/external_controller_test.exs b/test/plausible_web/controllers/api/external_controller_test.exsindex dd7318d6cc..75da468f27 100644--- a/test/plausible_web/controllers/api/external_controller_test.exs+++ b/test/plausible_web/controllers/api/external_controller_test.exs@@ -740,7 +740,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest doconn|> put_req_header("user-agent", @user_agent)- |> put_req_header("x-forwarded-for", "127.0.0.2")+ |> put_req_header("x-forwarded-for", "982.32.12.1")|> post("/api/event", params)[one, two] = get_events("user-id-test-domain-2.com")