Skip to content

Commit effd2b2

Browse files
committed
Fix Content-Type for Quart exceptions
Quart's `Response` defaults to `text/html` as the Content-Type, but when returning exceptions the response is plain text. Set the Content-Type to `text/plain` so that these are displayed correctly.
1 parent abbe4c2 commit effd2b2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

strawberry/quart/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ async def dispatch_request(self, **kwargs: object) -> "ResponseReturnValue":
145145
return Response(
146146
response=e.reason,
147147
status=e.status_code,
148+
content_type="text/plain",
148149
)
149150

150151
async def create_streaming_response(

0 commit comments

Comments
 (0)