parent
01708502d8
commit
8fe75ed63d
|
@ -4,7 +4,7 @@ from re import sub
|
||||||
from time import strftime, gmtime
|
from time import strftime, gmtime
|
||||||
|
|
||||||
from .exceptions import FileNotFound, InvalidUsage
|
from .exceptions import FileNotFound, InvalidUsage
|
||||||
from .response import send_file, HTTPResponse
|
from .response import file, HTTPResponse
|
||||||
|
|
||||||
|
|
||||||
def register(app, file_or_directory, uri, pattern, use_modified_since):
|
def register(app, file_or_directory, uri, pattern, use_modified_since):
|
||||||
|
@ -50,7 +50,7 @@ def register(app, file_or_directory, uri, pattern, use_modified_since):
|
||||||
return HTTPResponse(status=304)
|
return HTTPResponse(status=304)
|
||||||
headers['Last-Modified'] = modified_since
|
headers['Last-Modified'] = modified_since
|
||||||
|
|
||||||
return await send_file(file_path, headers=headers)
|
return await file(file_path, headers=headers)
|
||||||
except:
|
except:
|
||||||
raise FileNotFound('File not found',
|
raise FileNotFound('File not found',
|
||||||
path=file_or_directory,
|
path=file_or_directory,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user