handle incorrect hash
This commit is contained in:
@@ -526,6 +526,8 @@ def logout(name):
|
||||
@app.route('/e/<ehash>/<filename>', methods=['GET'])
|
||||
def download_expiring(ehash, filename = None):
|
||||
file_path, expiring = get_expiring_file(ehash)
|
||||
if file_path == None:
|
||||
return 'No such link', 404
|
||||
if not os.path.exists(file_path):
|
||||
return 'No such file', 404
|
||||
if expiring - time.time() < 0:
|
||||
|
||||
@@ -90,6 +90,7 @@ def expire_database_create():
|
||||
file text NOT NULL,
|
||||
expires integer NOT NULL
|
||||
);""")
|
||||
# Clear out expired items
|
||||
cursor.execute("DELETE FROM expiring WHERE expires < ?",
|
||||
(
|
||||
time.time(),
|
||||
|
||||
Reference in New Issue
Block a user