From 3a33b6f201d1a9ff33a903dda21f0684cb3752e4 Mon Sep 17 00:00:00 2001 From: Jumana B Date: Wed, 8 Jan 2025 13:28:41 -0500 Subject: [PATCH] Test with the real bearer token vs the fake one (#2032) Co-authored-by: Andrew --- app/main/validators.py | 2 +- app/main/views/api_keys.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/main/validators.py b/app/main/validators.py index 77ad8365b4..a0d7b4b49d 100644 --- a/app/main/validators.py +++ b/app/main/validators.py @@ -175,7 +175,7 @@ def validate_callback_url(service_callback_url, bearer_token): response = requests.post( url=service_callback_url, allow_redirects=True, - data={"health_check": "true"}, + json={"health_check": True}, headers={"Content-Type": "application/json", "Authorization": f"Bearer {bearer_token}"}, timeout=2, ) diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index 8b5100d578..efeb907317 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -192,7 +192,7 @@ def delete_delivery_status_callback(service_id): form = ServiceDeliveryStatusCallbackForm( url=delivery_status_callback.get("url") if delivery_status_callback else "", - bearer_token=dummy_bearer_token if delivery_status_callback else "", + bearer_token=delivery_status_callback.get("bearer") if delivery_status_callback else "", ) return render_template( @@ -216,7 +216,7 @@ def delivery_status_callback(service_id): form = ServiceDeliveryStatusCallbackForm( url=delivery_status_callback.get("url") if delivery_status_callback else "", - bearer_token=dummy_bearer_token if delivery_status_callback else "", + bearer_token=delivery_status_callback.get("bearer") if delivery_status_callback else "", ) if form.validate_on_submit():