Trying to subscribe to a webhook but I am getting an error about the 'WebHook-Allowed-Origin' header not being correct.
Response:
'type': 'urn:blackbaud:webhook-url-handshake-missing-origin-header',
'title': 'One or more validation errors occurred.',
'status': 400,
'detail': "Received an unexpected 'WebHook-Allowed-Origin' header value from your webhook URL when performing the CloudEvent's Abuse Protection handshake. The header must equal 'eventgrid.azure.net'. Review our Webhook API documentation to learn more. https://developer.blackbaud.com/skyapi/apis/webhook"
Code:
def cloud_events_handshake():
if env_vars['other']['hook_secret'] == request.args.get('webhookKey'):
event = from_http(request.headers, request.get_data())
if event['WebHook-Request-Origin'] == 'eventgrid.azure.net':
#resp = make_response(200)
response = Response(status=200, mimetype="application/json")
response.headers['WebHook-Allowed-Origin'] = 'eventgrid.azure.net'
return response
else:
abort(403)
The header is already set to the correct value, is there something I'm missing here?