Closed timkelty closed 7 months ago
Hi, I'm not sure I understand everything.
Could you clarify with:
Thanks!
Given a response with multi-value headers (2 unique headers with the same name), Bref will only keep the last header: https://github.com/brefphp/bref/blob/master/src/Event/Http/HttpResponse.php#L37
Eg, given
x-foo: bar
x-foo: baz
The APIG response will be constructed with only x-foo: baz
I expect headers with duplicate names to be joined with a ,
, which is API Gateway v2's default behavior:
So, x-foo: bar,baz
Format 2.0 doesn't have multiValueHeaders or multiValueQueryStringParameters fields. Duplicate headers are combined with commas and included in the headers field
So, it seems like Bref shouldn't do any special handling for these headers, and instead rely on APIG's default handling.
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
As API Gateway 2.0 doesn't support
multiValueHeaders
– Bref takes only the last value.It seems like a better solution to not do anything and allow APIG to join them with a comma – at least that way there isn't any data loss, and your app can adjust to get the values.
Related: https://github.com/brefphp/bref/issues/818