Use FALLBACK_ERROR_FORMAT for handlers that return empty() (#2659)

Co-authored-by: L. Karkkainen <tronic@users.noreply.github.com>
Co-authored-by: Adam Hopkins <adam@amhopkins.com>
This commit is contained in:
L. Kärkkäinen 2023-02-05 13:29:01 +00:00 committed by GitHub
parent 9cb9e88678
commit c7a71cd00c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -406,16 +406,13 @@ CONTENT_TYPE_BY_RENDERERS = {
v: k for k, v in RENDERERS_BY_CONTENT_TYPE.items() v: k for k, v in RENDERERS_BY_CONTENT_TYPE.items()
} }
# Handler source code is checked for which response types it returns with the
# route error_format="auto" (default) to determine which format to use.
RESPONSE_MAPPING = { RESPONSE_MAPPING = {
"empty": "html",
"json": "json", "json": "json",
"text": "text", "text": "text",
"raw": "text",
"html": "html", "html": "html",
"file": "html", "JSONResponse": "json",
"file_stream": "text",
"stream": "text",
"redirect": "html",
"text/plain": "text", "text/plain": "text",
"text/html": "html", "text/html": "html",
"application/json": "json", "application/json": "json",