def webhook_flash():
KEY = "secret"
DATA = request.get_data()
print "===============================================================";
print DATA;
print "===============================================================";
EXPECTED = ""
if not request.headers.get('X-Hub-Signature') is None :
EXPECTED = str(request.headers.get('X-Hub-Signature'))
if not EXPECTED :
print("Not signed. Not calculating");
else :
calculated = hmac.new(KEY, DATA, hashlib.sha1).hexdigest()
calculated = "sha1=" + (calculated)
print("Expected : " + EXPECTED);
print("Calculated: " + calculated);
print("Match? : " + str(calculated == EXPECTED));
pass
output = json.loads(DATA)
print("Topic Recieved: " + output["topic"]);
webhook_flask.py 文件源码
python
阅读 77
收藏 0
点赞 0
评论 0
评论列表
文章目录