added password check for DELETE method #7
@ -54,7 +54,7 @@ def create_app():
|
|||||||
@app.route('/presentation/<string:presentation>', methods=['DELETE'])
|
@app.route('/presentation/<string:presentation>', methods=['DELETE'])
|
||||||
def delete_presentation(presentation):
|
def delete_presentation(presentation):
|
||||||
data = request.get_json()
|
data = request.get_json()
|
||||||
if not data['auth'] or not _valid_credential(data['auth']):
|
if not 'auth' in data or not _valid_credential(data['auth']):
|
||||||
return Response(response="Use correct credentials to access this endpoint", status=401)
|
return Response(response="Use correct credentials to access this endpoint", status=401)
|
||||||
|
|
||||||
shutil.rmtree(os.path.join(storagedir, presentation))
|
shutil.rmtree(os.path.join(storagedir, presentation))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user