Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
Description
The original intention of the /files/read endpoint was just to pass through the file contents directly to the client.
Unfortunately at the time we decided to return the data via a JSON string and didn't quite realize that doing so consisted of interpreting the data as UTF-8 (this is the default JSON encoding and JSON strings are unicode). The original implementation would have had to encode the data (e.g. base64) into the JSON string for us to have been agnostic of encoding.
If the file contains any encoding other than UTF-8, we'll spit out an incorrect or invalid encoding of it into UTF-8 from the endpoint.
Ideally, we can instead spit out base64 data at the minimum, with potential support for the client telling us which encoding the file is expected (and us returning an error if invalid), or us trying to detect it, or something else.
Note that in the V1 API, this issue is resolved. The Response::ReadFile returns a bytes in protobuf or a base64 JSON string if the client wants JSON.
Attachments
Issue Links
- supercedes
-
MESOS-4642 Mesos Agent Json API can dump binary data from log files out as invalid JSON.
- Accepted