From 6897e5798491f9ec4885ea337df13b0e8e4560ac Mon Sep 17 00:00:00 2001 From: Adam Gardner Date: Thu, 15 Feb 2024 11:26:33 +1000 Subject: [PATCH] strip trailing slash from tenant_url in case present --- code/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/app.py b/code/app.py index a855849..740f81d 100644 --- a/code/app.py +++ b/code/app.py @@ -57,6 +57,9 @@ payload = json.loads(args.payload) debug_mode = args.debug +# Strip potential trailing slash in case user left it in +tenant_url = tenant_url.strip("/") + # Use incoming tenant_url to set the biz event ingest URL biz_event_url = f"{tenant_url}/api/v2/bizevents/ingest" @@ -112,7 +115,8 @@ ################################################ biz_event_url = f"{tenant_url}/api/v2/bizevents/ingest" biz_event_headers = { - "Authorization": f"Bearer {access_token_value}" + "Authorization": f"Bearer {access_token_value}", + "Content-Type": "application/json" } biz_event_resp = requests.post(