From 205bcd20b6b19fb35499aa7965da75e399893872 Mon Sep 17 00:00:00 2001 From: Ben White Date: Tue, 17 Dec 2024 16:20:25 +0100 Subject: [PATCH 1/2] Fix json sending --- posthog/models/remote_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index e525fb80d28f1..17e6d45a40a8d 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -401,7 +401,7 @@ def _purge_cdn(self): res = requests.post( settings.REMOTE_CONFIG_CDN_PURGE_ENDPOINT, headers={"Authorization": f"Bearer {settings.REMOTE_CONFIG_CDN_PURGE_TOKEN}"}, - data=data, + json=data, ) if res.status_code != 200: From d86350bec65d7c4837551d7abe961aef0b91a02a Mon Sep 17 00:00:00 2001 From: Ben White Date: Tue, 17 Dec 2024 16:41:03 +0100 Subject: [PATCH 2/2] Fix --- posthog/models/test/test_remote_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index 9afe0a99e1370..e90e3a9edd580 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -457,7 +457,7 @@ def test_purges_cdn_cache_on_sync(self, mock_post): mock_post.assert_called_once_with( "https://api.cloudflare.com/client/v4/zones/MY_ZONE_ID/purge_cache", headers={"Authorization": "Bearer MY_TOKEN"}, - data={ + json={ "files": [ {"url": "https://cdn.posthog.com/array/phc_12345/config"}, {"url": "https://cdn.posthog.com/array/phc_12345/config.js"},