Ben Whitehead created MESOS-3739:
------------------------------------

             Summary: Mesos does not set Content-Type for 400 Bad Request
                 Key: MESOS-3739
                 URL: https://issues.apache.org/jira/browse/MESOS-3739
             Project: Mesos
          Issue Type: Bug
          Components: HTTP API
    Affects Versions: 0.25.0, 0.24.1, 0.24.0
            Reporter: Ben Whitehead


While integrating with the HTTP Scheduler API I encountered the following 
scenario.

The message below was serialized to protobuf and sent as the POST body
{code:title=message}
call {
  type: ACKNOWLEDGE,
  acknowledge: {
    uuid: <bytes>,
    agentID: { value: "20151012-182734-16777343-5050-8978-S2" },
    taskID: { value: "task-1" }
  }
}
{code}
{code:title=Request Headers}
POST /api/v1/scheduler HTTP/1.1
Content-Type: application/x-protobuf
Accept: application/x-protobuf
Content-Length: 73
Host: localhost:5050
User-Agent: RxNetty Client
{code}

I received the following response
{code:title=Response Headers}
HTTP/1.1 400 Bad Request
Date: Wed, 14 Oct 2015 23:21:36 GMT
Content-Length: 74

Failed to validate Scheduler::Call: Expecting 'framework_id' to be present
{code}

Even though my accept header made no mention of {{text/plain}} the message body 
returned to me is {{text/plain}}. Additionally, there is no {{Content-Type}} 
header set on the response so I can't even do anything intelligently in my 
response handler.



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

Reply via email to