fix(web): fix response to periodic POST requests (#344)

The reason POST requests were being responded to with 400 is that in the
assignment of payload, the request.json member is used if request.form
evaluates as false, but accessing request.json results in an error for
some requests, even though flask docs claim that the value will simply
be `None`.

resolves #339
This commit is contained in:
Dexter Gaon-Shatford 2022-11-02 15:38:49 -04:00 committed by GitHub
parent 6f837cd50d
commit 8a1202bad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -335,7 +335,7 @@ def status():
def post():
global log
payload = request.form if request.form else request.json
payload = request.get_json() if request.is_json else request.form
if payload:
log.debug("web: Post request from %s: %s" % (request.remote_addr, str(payload)))