How to change Micro gateway "transfer-encoding":"chunked"?

rafael
New Member

Hi,

While using the micro gateway I noticed that the headers get changed, to be able to handle large requests/response, into chunks. I see the point of doing that though some APIs (public/private) won't be able to handle "chunked" requests and will require the content length.

After some research I found out on this link: https://community.apigee.com/comments/34928/view.html that the plugin accumulate-request won't be enough to fix the issue and that it may be bug that's to be fixed but there are no updates since 2016.

Does anyone knows a way to not send all the requests as chunked parts including a content-length header?

The solution presented on the same link (WEB --> EMGW --> HTTP_1.0_PROXY --> API) is not really ideal for the general use case for this time.

References:
- Code Reference: https://github.com/apigee/microgateway-core/blob/master/lib/plugins-middleware.js#L197
- Discussion: https://community.apigee.com/questions/34164/content-length-gets-converted-to-transfer-encoding.html
- Suggested Solution that doesn't work: https://github.com/apigee/microgateway-plugins/blob/master/accumulate-request/index.js

Thank you all, I really appreciate you taking time to read and help with it!

0 2 968
2 REPLIES 2

Can it be the same issue as in S3 (Amazon Simple Storage Service)? I had issues with it a couple of years ago - my assumption was that the reason could have been Transfer-Encoding wrapping a Content-Encoding. Is that possible? I found about GitHub issue as well - Header "Transfer-Encoding: chunked" set even if Content-Length is provided by term paper writer which causes body to not actually get chunked

Dear all,

we've opened PR

https://github.com/apigee/microgateway-core/pull/145

to enable a switch which allows to preserve the content encoding set by the Client. Google is reviewing our Code and the Testcases, hopefully we get this Option soon.