Skip to content
Permalink
Browse files

Add webhook content type comments (#301)

  • Loading branch information...
aadibajpai authored and canihavesomecoffee committed Jun 18, 2019
1 parent f9bab05 commit 2062fba2f8aca85bc25a8d6ca327c791a704964b
Showing with 2 additions and 0 deletions.
  1. +2 −0 mod_deploy/controllers.py
@@ -90,6 +90,8 @@ def deploy():
return json.dumps({'msg': "Wrong event type"})

x_hub_signature = request.headers.get('X-Hub-Signature')
# webhook content type should be application/json for request.data to have the payload
# request.data is empty in case of x-www-form-urlencoded
if not is_valid_signature(x_hub_signature, request.data, g.github['deploy_key']):
g.log.warning('Deploy signature failed: {sig}'.format(sig=x_hub_signature))
abort(abort_code)

0 comments on commit 2062fba

Please sign in to comment.
You can’t perform that action at this time.