Return 416 if Range doesn't start with bytes=
This commit is contained in:
		
							parent
							
								
									de3b346c14
								
							
						
					
					
						commit
						3a30cf29c1
					
				| 
						 | 
				
			
			@ -110,6 +110,14 @@ async def handler(request):
 | 
			
		|||
                    }
 | 
			
		||||
                )
 | 
			
		||||
            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
 | 
			
		||||
    headers = {
 | 
			
		||||
        'Content-Range': f'bytes {offset}-{end}/{max_size}',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue