mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
19 lines
493 B
Python
19 lines
493 B
Python
from flask import current_app
|
|
import requests
|
|
|
|
|
|
def confirm_subscription(confirmation_request):
|
|
url = confirmation_request.get('SubscribeURL')
|
|
if not url:
|
|
current_app.logger.warning("SubscribeURL does not exist or empty")
|
|
return
|
|
|
|
response = requests.get(url)
|
|
try:
|
|
response.raise_for_status()
|
|
except Exception as e:
|
|
current_app.logger.warning("Response: {}".format(response.text))
|
|
raise e
|
|
|
|
return confirmation_request['TopicArn']
|