BaseView.as_asgi is now .as_view, refs #870

This commit is contained in:
Simon Willison 2020-06-28 16:47:40 -07:00
commit 4dad028432
3 changed files with 22 additions and 28 deletions

View file

@ -269,8 +269,8 @@ async def asgi_send_file(
def asgi_static(root_path, chunk_size=4096, headers=None, content_type=None):
async def inner_static(scope, receive, send):
path = scope["url_route"]["kwargs"]["path"]
async def inner_static(request, send):
path = request.scope["url_route"]["kwargs"]["path"]
try:
full_path = (Path(root_path) / path).resolve().absolute()
except FileNotFoundError: