Return 416 if Range doesn't start with bytes=

This commit is contained in:
blank X 2021-06-06 22:03:47 +07:00
parent de3b346c14
commit 3a30cf29c1
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 8 additions and 0 deletions

View File

@ -110,6 +110,14 @@ async def handler(request):
} }
) )
status = 206 status = 206
else:
return web.Response(status=416,
text='Unknown range type',
headers={
'Content-Range': f'bytes */{max_size}',
'Accept-Ranges': 'bytes'
}
)
length = end - offset + 1 length = end - offset + 1
headers = { headers = {
'Content-Range': f'bytes {offset}-{end}/{max_size}', 'Content-Range': f'bytes {offset}-{end}/{max_size}',