瀏覽代碼

Encode variable

JoostSijm 6 年之前
父節點
當前提交
b33bcf9007
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/flaskr.py

+ 1 - 1
app/flaskr.py

@@ -21,7 +21,7 @@ def index():
 @app.route('/deploy', methods=['POST'])
 def deploy():
     """Run deploy script"""
-    secret = os.environ["WEBHOOK_KEY"]
+    secret = os.environ["WEBHOOK_KEY"].encode('utf-8')
     digest = hmac.new(secret, request.data, hashlib.sha256).hexdigest()
     signature = request.headers['X-Gogs-Signature']
     if len(signature) < 2 or not hmac.compare_digest(signature, digest):