Change response codes
This commit is contained in:
parent
519c68c455
commit
29af01c619
@ -34,18 +34,16 @@ def ingress(key):
|
|||||||
"content-type": content_type,
|
"content-type": content_type,
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
abort(401)
|
return make_response("", 404)
|
||||||
|
|
||||||
resp = make_response("", 201)
|
return make_response("", 201)
|
||||||
return resp
|
|
||||||
|
|
||||||
@app.route("/data/<string:name>/")
|
@app.route("/data/<string:name>/")
|
||||||
def data(name):
|
def data(name):
|
||||||
if not name in config:
|
if not name in config:
|
||||||
abort(404)
|
return make_response("", 404)
|
||||||
if not name in values:
|
if not name in values:
|
||||||
resp = make_response("", 204)
|
return make_response("", 404)
|
||||||
return resp
|
|
||||||
resp = make_response(values[name]["payload"], 200)
|
resp = make_response(values[name]["payload"], 200)
|
||||||
resp.headers['content-type'] = values[name]["content-type"]
|
resp.headers['content-type'] = values[name]["content-type"]
|
||||||
return resp
|
return resp
|
||||||
|
Loading…
Reference in New Issue
Block a user