Removing default headers generated by apigee edge microgateway from reaching Backend service.

Hi, we have a scenario where we are sending a request to our clients backend service through apigee edge microgateway. The response we are getting back is 400 bad request.When we make the same request directly to the Backend service without using microgateway it works fine and we get a HTTP 200 response.

We found out some of the headers( Transfer-encoding) generated by the Microgateway which were being sent to the backend service is causing an issue. The reason is the backend doesnt support Transfer-encoding header and we are not in position to make the Backend support the Transfer-encoding header.

Do we have a solution where we can prevent this header from going to the Backend. please help us out @srinandans since we are on the edge of our deadline.

0 6 542
6 REPLIES 6

@Dino-at-Google can u please help us on this issue?

@srinandans need your expert advice in here. Thanks.

Former Community Member
Not applicable

Microgateway has streaming enabled. Therefore, transfer-encoding is always set to "chunked". If the backend cannot deal with streaming, then you'd have to accumulate the chunks in microgateway, compute the content-length and send the data to the target. A example to accumulate requests is here.

great @srinandans. one quick question do we need to write a custom plugin which would take the request object from accumulate-request plugin in order to send the request to the backend.


Former Community Member
Not applicable

accumulate-request is only a sample. You can modify it. If you are creating a custom plugin, then there is no need to use accumulate-request (just add similar logic to your custom plugin).

Remember to create the content-length header and compute the length of the payload.

hey @srinandans i tried the plugin and receiving the following error response:

{"message":"socket hang up","code":"ECONNRESET"}

please help me on this issue.