You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "zhou xing (JIRA)" <ji...@apache.org> on 2016/07/19 02:14:20 UTC

[jira] [Created] (MESOS-5858) Operator API should accept the request with charset specified in Content-Type

zhou xing created MESOS-5858:
--------------------------------

             Summary: Operator API should accept the request with charset specified in Content-Type
                 Key: MESOS-5858
                 URL: https://issues.apache.org/jira/browse/MESOS-5858
             Project: Mesos
          Issue Type: Bug
            Reporter: zhou xing
            Priority: Minor


When requesting from client like WebUI, the Content-Type of the request maybe set to
```application/json; charset=utf-8```
, the request will get 415 response code with message
```Expecting 'Content-Type' of application/json or application/x-protobuf```

The following code in http.cpp just compare the content-type of the request directly with “application/json” or “application/x-protobuf”:
```...
  if (contentType.get() == APPLICATION_PROTOBUF) {
    if (!v1Call.ParseFromString(request.body)) {
      return BadRequest("Failed to parse body into Call protobuf");
    }
  } else if (contentType.get() == APPLICATION_JSON) {
…
We need to accept a request with charset set in Content-Type



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)