Getting "Duplicate Header \"Date\"" and "errorcode": "protocol.http.DuplicateHeader"

We are getting 502 Errors and the detailed error message shows this:

{"response":{"data":null,"header":{"message":"Bad Gateway","error":{"detail":"Duplicate Header \"Date\"","code":""},"status":502,"message_detail":null,"response_detail":{"total_time":"653 ms","unix_timestamp":1467878107,"processing_time":"576 ms","backend_time":"77 ms","date_time":"2016-07-07T07:55:07.128Z"}}}}

The backend seems to be sending the duplicate headers and also the Date header has multiple values like this:

Date: Thu, 07 Jul 2016 08:41:54 GMT, Thu, 07 Jul 2016 08:41:54 GMT

How can we get this issue resolved ?

Solved Solved
0 3 1,415
1 ACCEPTED SOLUTION

Checked the Message Processor’s http.properties and found that the property “HTTPHeader.Date” was set as follows:

HTTPHeader.Date=

We need to set this property as follows:

HTTPHeader.Date=allowDuplicates, multiValued

This would allow duplicates and multiple values for the Date header.

Making the above change and restarting the Message Processors resolved the issue.

View solution in original post

3 REPLIES 3

Checked the Message Processor’s http.properties and found that the property “HTTPHeader.Date” was set as follows:

HTTPHeader.Date=

We need to set this property as follows:

HTTPHeader.Date=allowDuplicates, multiValued

This would allow duplicates and multiple values for the Date header.

Making the above change and restarting the Message Processors resolved the issue.

For Apigee Private Cloud, the CWC property to set would be:

conf_http_HTTPHeader.Date=allowDuplicates, multiValued

add that to the /opt/apigee/customer/application/message-processor.properties
make sure that file is owned by apigee:apigee user

restart the MPs to have it take effect.

btw you can do that for any header, the pattern is .{HEADER_NAME}=properties