Hi,
I use an express middleware that set to chunked the transfer-encoding headers
'transfer-encoding': 'chunked'
In that case, I get the following error :
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
To make my request works, in the forwardResponseToApiGateway function of the aws-serverless-express/index.js file I remove this header.
Do you think you could make chunked transfert encoding pass ?
Chunked transfer is something we are looking into; unfortunately, for now
you will need to disable it.
On Wed, 19 Oct 2016, 07:25 Anthony Denneulin, [email protected]
wrote:
Hi,
I use an express middleware that set to chunked the transfer-encoding
headers'transfer-encoding': 'chunked'
In that case, I get the following error :
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either
the attempt failed or the origin closed the connection.To make my request works, in the forwardResponseToApiGateway function of
the aws-serverless-express/index.js file I remove this header.Do you think you could make chunked transfert encoding pass ?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-serverless-express/issues/10, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABy6l2mkJhh8RIJXLdgJxYJNydLZImRBks5q1ihQgaJpZM4KbCVz
.
That's really annoying but thanks for your answer ;)
Why is this closed? Is it solved?
This is a limitation with API Gateway, and not the library. However, I will reopen this issue for tracking and notification purposes.
Thanks brettstack.
for those seeking a temporary solution mentioned by @denneulin above. Add 'delete headers' as below in the forwardResponseToApiGateway function.
delete headers["transfer-encoding"]
const successResponse = {statusCode, body, headers}
This should be working now. You don't need to explicitly remove the 'transfer-encoding' header anymore.
@abhigna I think the transfer-encoding: chunked issue still exists. I've tried to use aws-serverless-express with graphql-server-express today and I run into the same issue as @denneulin
Chunked encoding still isn't working, but we are now deleting the header for you https://github.com/awslabs/aws-serverless-express/commit/4d54a81b831eca97524f15b72fa8be379c80aedb#diff-168726dbe96b3ce427e7fedce31bb0bcR54
Most helpful comment
@abhigna I think the
transfer-encoding: chunkedissue still exists. I've tried to useaws-serverless-expresswithgraphql-server-expresstoday and I run into the same issue as @denneulin