dart_frog
dart_frog copied to clipboard
fix: UTF-8 chars "outside" ASCII will set content-type to application/octet-stream
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
- 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.