Closed guidiaz closed 1 year ago
The conversion from bytes to string is implemented here:
We are using this method from the surf library, which only supports UTF8: https://docs.rs/surf/2.3.2/surf/struct.Response.html#method.body_string
There is a body_bytes method which returns the raw bytes: https://docs.rs/surf/2.3.2/surf/struct.Response.html#method.body_bytes
So we could add a check like:
The only problem is that we cannot access the request headers from RADON to read the content type, so converting the bytes into a string later will only be possible if we know the encoding ahead of time when creating the script. Similarly, when converting string to bytes we need to specify an encoding somehow. But encodings other than UTF8 are not supported yet, so that can be another issue.
Superseeded by #2331