Closed mattjala closed 7 months ago
Adding Content-Type: application/json; charset=utf-8
to the requests headers before the request is made fixes this.
If clients want their data to be parsed correctly, it seem they'll have to do this on their side, since the decoding occurs when request.json()
is invoked, and that doesn't take an encoding parameter after the server receives it.
Regardless, HSDS should certainly be able to handle this more gracefully. Wrapping request.json()
in a try-except block doesn't prevent an exception from being raised to the HSDS application level, which is strange.
Resolved in #326. Manually enforcing UTF-8 in the main process and stderr streams fixes the initial encoding error and the following crash.
Test to replicate the error (on
windows-latest
or Windows 10):Output from HSDS:
This looks like another case of Windows defaulting to the 1252 encoding instead of UTF-8.