pep8
This commit is contained in:
parent
ca596c8ecd
commit
ff5786d61b
|
@ -18,7 +18,8 @@ from sanic.response import file, file_stream, HTTPResponse
|
||||||
|
|
||||||
def register(app, uri, file_or_directory, pattern,
|
def register(app, uri, file_or_directory, pattern,
|
||||||
use_modified_since, use_content_range,
|
use_modified_since, use_content_range,
|
||||||
stream_large_files, name='static', host=None, strict_slashes=None):
|
stream_large_files, name='static', host=None,
|
||||||
|
strict_slashes=None):
|
||||||
# TODO: Though sanic is not a file server, I feel like we should at least
|
# TODO: Though sanic is not a file server, I feel like we should at least
|
||||||
# make a good effort here. Modified-since is nice, but we could
|
# make a good effort here. Modified-since is nice, but we could
|
||||||
# also look into etags, expires, and caching
|
# also look into etags, expires, and caching
|
||||||
|
@ -103,7 +104,7 @@ def register(app, uri, file_or_directory, pattern,
|
||||||
if isinstance(stream_large_files, int):
|
if isinstance(stream_large_files, int):
|
||||||
threshold = stream_large_files
|
threshold = stream_large_files
|
||||||
else:
|
else:
|
||||||
threshold = 1024*1000
|
threshold = 1024 * 1000
|
||||||
|
|
||||||
if not stats:
|
if not stats:
|
||||||
stats = await stat(file_path)
|
stats = await stat(file_path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user