You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When returning a Response with a body that contains a non-ASCII character, like "ö, ä, ü, etc." in german or a 😊 for that matter, the responses content-type will be set to application/octet-stream.
That in turn will result in "save file" dialog if the route was called in a browser.
Steps To Reproduce
create new dart frog project
add a utf-8 character that isn't in ASCII as well to the Response body in index.dart
run dev server
call in Browser
Expected Behavior
Getting a text/plain response (with utf-8 encoding) when using utf-8 character in a Response body String.
Additional Context
My apologies if this is expected behavior.
This basically doesn't matter that much if one would use dart frog for an API or just set the header manually, but it took me quite some time to figure out what is wrong when doing the tutorials.
The text was updated successfully, but these errors were encountered:
Would you be able to upload a minimal reproductive project with this setup so we can take a look at it locally? From the details that you described here the team believes that this is expected behavior. We think this is actually being driven by the default behavior of shelf in that if it sees something in the response body that doesn't fit with utf-8 encoding then it will default back to the application/octet-stream response type.
Sure, I created a new project, added the route /with_umlaut by adding /routes/with_umlaut.dart and zipped it before the first start with dart_frog dev.
It shows the described behavior on the /with_umlaut route.
Attached of course :-) utf8_test.zip
Description
When returning a Response with a body that contains a non-ASCII character, like "ö, ä, ü, etc." in german or a 😊 for that matter, the responses content-type will be set to application/octet-stream.
That in turn will result in "save file" dialog if the route was called in a browser.
Steps To Reproduce
Expected Behavior
Getting a text/plain response (with utf-8 encoding) when using utf-8 character in a Response body String.
Additional Context
My apologies if this is expected behavior.
This basically doesn't matter that much if one would use dart frog for an API or just set the header manually, but it took me quite some time to figure out what is wrong when doing the tutorials.
The text was updated successfully, but these errors were encountered: