From 35aee82c60b2c9a0185b934db5528c8bd11830f2 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sun, 28 Jun 2020 21:27:11 -0700 Subject: [PATCH] Fixed 500 error with /favicon.ico, closes #874 --- datasette/app.py | 2 +- tests/test_html.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/datasette/app.py b/datasette/app.py index ceaf36f2..d4c959b7 100644 --- a/datasette/app.py +++ b/datasette/app.py @@ -160,7 +160,7 @@ CONFIG_OPTIONS = ( DEFAULT_CONFIG = {option.name: option.default for option in CONFIG_OPTIONS} -async def favicon(scope, receive, send): +async def favicon(request, send): await asgi_send(send, "", 200) diff --git a/tests/test_html.py b/tests/test_html.py index c80a7685..d1411afd 100644 --- a/tests/test_html.py +++ b/tests/test_html.py @@ -52,6 +52,12 @@ def test_http_head(app_client): assert response.status == 200 +def test_favicon(app_client): + response = app_client.get("/favicon.ico") + assert response.status == 200 + assert "" == response.text + + def test_static(app_client): response = app_client.get("/-/static/app2.css") assert response.status == 404