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:
parent
9cb9e88678
commit
c7a71cd00c
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user