Skip to content

Commit 72c0ed1

Browse files
authored
Switch us-api.i hosts to just us.i (#119)
We dropped the -api as it's a bit confusing (is capture really api?)
1 parent 5fdd617 commit 72c0ed1

File tree

5 files changed

+19
-15
lines changed

5 files changed

+19
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.5.1 - 2024-08-13
2+
3+
1. Remove "-api" suffix from ingestion hostnames
4+
15
## 3.5.0 - 2024-02-29
26

37
1. - Adds a new `feature_flags_request_timeout_seconds` timeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.

posthog/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
_session = requests.sessions.Session()
1515

16-
US_INGESTION_ENDPOINT = "https://us-api.i.posthog.com"
17-
EU_INGESTION_ENDPOINT = "https://eu-api.i.posthog.com"
16+
US_INGESTION_ENDPOINT = "https://us.i.posthog.com"
17+
EU_INGESTION_ENDPOINT = "https://eu.i.posthog.com"
1818
DEFAULT_HOST = US_INGESTION_ENDPOINT
1919
USER_AGENT = "posthog-python/" + VERSION
2020

posthog/test/test_client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def test_basic_capture_with_feature_flags_returns_active_only(self, patch_decide
314314
self.assertEqual(patch_decide.call_count, 1)
315315
patch_decide.assert_called_with(
316316
"random_key",
317-
"https://us-api.i.posthog.com",
317+
"https://us.i.posthog.com",
318318
timeout=3,
319319
distinct_id="distinct_id",
320320
groups={},
@@ -356,7 +356,7 @@ def test_basic_capture_with_feature_flags_and_disable_geoip_returns_correctly(se
356356
self.assertEqual(patch_decide.call_count, 1)
357357
patch_decide.assert_called_with(
358358
"random_key",
359-
"https://us-api.i.posthog.com",
359+
"https://us.i.posthog.com",
360360
timeout=12,
361361
distinct_id="distinct_id",
362362
groups={},
@@ -784,7 +784,7 @@ def test_disable_geoip_default_on_decide(self, patch_decide):
784784
client.get_feature_flag("random_key", "some_id", disable_geoip=True)
785785
patch_decide.assert_called_with(
786786
"random_key",
787-
"https://us-api.i.posthog.com",
787+
"https://us.i.posthog.com",
788788
timeout=3,
789789
distinct_id="some_id",
790790
groups={},
@@ -796,7 +796,7 @@ def test_disable_geoip_default_on_decide(self, patch_decide):
796796
client.feature_enabled("random_key", "feature_enabled_distinct_id", disable_geoip=True)
797797
patch_decide.assert_called_with(
798798
"random_key",
799-
"https://us-api.i.posthog.com",
799+
"https://us.i.posthog.com",
800800
timeout=3,
801801
distinct_id="feature_enabled_distinct_id",
802802
groups={},
@@ -808,7 +808,7 @@ def test_disable_geoip_default_on_decide(self, patch_decide):
808808
client.get_all_flags_and_payloads("all_flags_payloads_id")
809809
patch_decide.assert_called_with(
810810
"random_key",
811-
"https://us-api.i.posthog.com",
811+
"https://us.i.posthog.com",
812812
timeout=3,
813813
distinct_id="all_flags_payloads_id",
814814
groups={},

posthog/test/test_request.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def test_should_timeout(self):
5555
("https://us.posthog.com.rg.proxy.com", "https://us.posthog.com.rg.proxy.com"),
5656
("app.posthog.com", "app.posthog.com"),
5757
("eu.posthog.com", "eu.posthog.com"),
58-
("https://app.posthog.com", "https://us-api.i.posthog.com"),
59-
("https://eu.posthog.com", "https://eu-api.i.posthog.com"),
60-
("https://us.posthog.com", "https://us-api.i.posthog.com"),
61-
("https://app.posthog.com/", "https://us-api.i.posthog.com"),
62-
("https://eu.posthog.com/", "https://eu-api.i.posthog.com"),
63-
("https://us.posthog.com/", "https://us-api.i.posthog.com"),
64-
(None, "https://us-api.i.posthog.com"),
58+
("https://app.posthog.com", "https://us.i.posthog.com"),
59+
("https://eu.posthog.com", "https://eu.i.posthog.com"),
60+
("https://us.posthog.com", "https://us.i.posthog.com"),
61+
("https://app.posthog.com/", "https://us.i.posthog.com"),
62+
("https://eu.posthog.com/", "https://eu.i.posthog.com"),
63+
("https://us.posthog.com/", "https://us.i.posthog.com"),
64+
(None, "https://us.i.posthog.com"),
6565
],
6666
)
6767
def test_routing_to_custom_host(host, expected):

posthog/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION = "3.5.0"
1+
VERSION = "3.5.1"
22

33
if __name__ == "__main__":
44
print(VERSION, end="") # noqa: T201

0 commit comments

Comments
 (0)