You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Benjamin Mahler (JIRA)" <ji...@apache.org> on 2017/10/17 01:52:00 UTC

[jira] [Created] (MESOS-8103) The /files/read endpoint assumes UTF-8 encoding of file contents.

Benjamin Mahler created MESOS-8103:
--------------------------------------

             Summary: The /files/read endpoint assumes UTF-8 encoding of file contents.
                 Key: MESOS-8103
                 URL: https://issues.apache.org/jira/browse/MESOS-8103
             Project: Mesos
          Issue Type: Bug
            Reporter: Benjamin Mahler


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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)