Skip to content

Commit

Permalink
strip trailing slash from tenant_url in case present
Browse files Browse the repository at this point in the history
  • Loading branch information
agardnerIT committed Feb 15, 2024
1 parent b4eac88 commit 6897e57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion code/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 6897e57

Please sign in to comment.