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

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

    [ https://issues.apache.org/jira/browse/MESOS-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15386353#comment-15386353 ] 

Abhishek Dasgupta commented on MESOS-5858:
------------------------------------------

RR:
https://reviews.apache.org/r/50246/
https://reviews.apache.org/r/50249/

cc: [~dongdong] Please check if it meets your requirements.


> 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
>            Assignee: Abhishek Dasgupta
>            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)