404 correctly on missing audio files.
This commit is contained in:
parent
2b2e77fb27
commit
1b6b3aa9c8
1 changed files with 6 additions and 1 deletions
|
@ -426,7 +426,12 @@ async def audio_file(request, type: str, id: int):
|
||||||
filename = get_normalised_filename_if_available(filename)
|
filename = get_normalised_filename_if_available(filename)
|
||||||
|
|
||||||
# Send file or 404
|
# Send file or 404
|
||||||
return await file(filename)
|
try:
|
||||||
|
response = await file(filename)
|
||||||
|
except FileNotFoundError:
|
||||||
|
abort(404)
|
||||||
|
return
|
||||||
|
return response
|
||||||
|
|
||||||
|
|
||||||
# Static Files
|
# Static Files
|
||||||
|
|
Loading…
Reference in a new issue