better message sending

This commit is contained in:
2026-08-26 18:43:12 +02:00
parent f431432eb0
commit 22fb3809af
3 changed files with 16 additions and 2 deletions
+11 -1
View File
@@ -41,7 +41,17 @@ def send_event(message: dict, event_url: str, timeout: float = 10) -> None:
if not event_url:
raise ValueError("event_url is required")
response = requests.post(event_url, json=message, timeout=timeout)
response = requests.post(
event_url,
json=message,
timeout=timeout,
allow_redirects=False,
)
if response.is_redirect:
raise requests.HTTPError(
f"event endpoint redirected to {response.headers.get('Location', '')}",
response=response,
)
response.raise_for_status()