Return 204, no content

This commit is contained in:
Ben 2019-07-19 13:53:00 +02:00
parent 75f836ea26
commit 399b53b88a
Signed by: ben
GPG key ID: 0F54A7ED232D3319

5
wmn.py
View file

@ -17,7 +17,7 @@ with open("config.yml", 'r') as ymlfile:
cfg = yaml.safe_load(ymlfile) cfg = yaml.safe_load(ymlfile)
@application.route('/matrix', methods=['POST']) @application.route('/matrix', methods=("POST",))
def notify(): def notify():
channel = request.args.get('channel') channel = request.args.get('channel')
if channel is None or len(channel) == 0: if channel is None or len(channel) == 0:
@ -50,4 +50,5 @@ def notify():
body=f"{username} pushed {len(commit_messages)} commits to {project_name}\n{text_commits}\n", body=f"{username} pushed {len(commit_messages)} commits to {project_name}\n{text_commits}\n",
msgtype="m.notice") msgtype="m.notice")
return "" # see Flask.make_response, this is interpreted as (body, status)
return "", 204