dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.74k stars 167 forks source link

If a header's value is an array, convert it to csv to make API Gatewa… #14

Closed bdgamble closed 7 years ago

bdgamble commented 7 years ago

…y accept the response

Add real-world test where koa-router does this and it breaks api-gateway

bdgamble commented 7 years ago

@dougmoscrop

dougmoscrop commented 7 years ago

join(', ') (with space after comma) maybe? seems more like what docs show everywheree

panva commented 7 years ago

You can actually work your way around the 1 unique header limitation > see https://github.com/awslabs/aws-serverless-express/pull/41

I think that's what users of a library such as this would expect, if i set two set-cookie headers, two set-cookie headers reach the browser. Not one which is malformed and rejected/

dougmoscrop commented 7 years ago

@panva interesting, thanks for the tip. this isn't the same issue per se (this is the case where the header itself supports comma separated values, but in code it is set as an array and not serialized correctly to APIG)

just to be clear this is the problem (some koa library does this):

addHeader('Allow', ['GET', 'PUT'])

not:

addHeader('Allow', 'GET') addHeader('Allow', 'PUT')

panva commented 7 years ago

overcoming some koa library should really come lower in priority than, i.e. being able to send more than one cookie :)

dougmoscrop commented 7 years ago

I created an issue for it. This code is already written and fixes a real world bug we have.

On Fri, Feb 3, 2017, 4:15 PM Filip Skokan notifications@github.com wrote:

overcoming some koa library should really come lower in priority than, i.e. being able to send more than one cookie :)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/dougmoscrop/serverless-http/pull/14#issuecomment-277364116, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjzFOhI3WBliBCyQDRH79CZjhej9GZMks5rY5jhgaJpZM4L1wYA .