chore: refactor code quality issues (#2044)

This commit is contained in:
Aksh Gupta
2021-03-05 13:56:03 +05:30
committed by GitHub
parent 00a1ee0cb6
commit 0d2d62eae5
13 changed files with 35 additions and 21 deletions

View File

@@ -374,7 +374,7 @@ def test_file_head_response(app, file_name, static_file_directory):
file_path = os.path.join(static_file_directory, filename)
file_path = os.path.abspath(unquote(file_path))
stats = await async_os.stat(file_path)
headers = dict()
headers = {}
headers["Accept-Ranges"] = "bytes"
headers["Content-Length"] = str(stats.st_size)
if request.method == "HEAD":
@@ -450,7 +450,7 @@ def test_file_stream_head_response(app, file_name, static_file_directory):
async def file_route(request, filename):
file_path = os.path.join(static_file_directory, filename)
file_path = os.path.abspath(unquote(file_path))
headers = dict()
headers = {}
headers["Accept-Ranges"] = "bytes"
if request.method == "HEAD":
# Return a normal HTTPResponse, not a