mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 09:33:19 +03:00
Adjust tests
This commit is contained in:
parent
bd797c201f
commit
7e772151e3
@ -175,10 +175,9 @@ defmodule PlausibleWeb.Api.ExternalController do
|
||||
result =
|
||||
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_code
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -740,7 +740,7 @@ defmodule PlausibleWeb.Api.ExternalControllerTest do
|
||||
|
||||
conn
|
||||
|> 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")
|
||||
|
Loading…
Reference in New Issue
Block a user