From 580ed5bf04ba7a80ff7e8af77a3d377d6d18e6a9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 2 Jan 2019 19:05:01 +0100 Subject: [PATCH] Use POST request in github hooks --- webserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webserver.py b/webserver.py index 4e7f3e9e..6c0e55b4 100644 --- a/webserver.py +++ b/webserver.py @@ -402,13 +402,14 @@ def ses_identify(): return response -@app.route("/hooks/github") +@app.route("/hooks/github", methods=["POST"]) def hooks_github(): try: j = request.get_json() except Exception: abort(400) return + # TODO: add secret check message = f"🐙 {j['size']} aggiornamenti a Royalnet ricevuti:\n" for commit in j.get("commits", []): message += f"{commit['message']} di {commit['author']}\n"