@h4ad/serverless-adapter 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,6 +69,7 @@ class ApiGatewayV2Adapter {
69
69
  */
70
70
  getResponse({ headers: responseHeaders, body, isBase64Encoded, statusCode, response, }) {
71
71
  const headers = (0, core_1.getFlattenedHeadersMap)(responseHeaders);
72
+ const multiValueHeaders = (0, core_1.getMultiValueHeadersMap)(responseHeaders);
72
73
  const transferEncodingHeader = headers['transfer-encoding'];
73
74
  const hasTransferEncodingChunked = transferEncodingHeader && transferEncodingHeader.includes('chunked');
74
75
  if (hasTransferEncodingChunked) {
@@ -77,16 +78,15 @@ class ApiGatewayV2Adapter {
77
78
  if (response === null || response === void 0 ? void 0 : response.chunkedEncoding) {
78
79
  throw new Error('chunked encoding in response is not supported by API Gateway V1');
79
80
  }
80
- const cookies = headers['set-cookie'];
81
- if (cookies) {
82
- headers.cookies = cookies;
81
+ const cookies = multiValueHeaders['set-cookie'];
82
+ if (headers)
83
83
  delete headers['set-cookie'];
84
- }
85
84
  return {
86
85
  statusCode,
87
86
  body,
88
87
  headers,
89
88
  isBase64Encoded,
89
+ cookies,
90
90
  };
91
91
  }
92
92
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h4ad/serverless-adapter",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "This library enables you to utilize any Cloud or Event Source to respond to web and API requests using your existing Node.js application framework.",
5
5
  "main": "./lib/index.js",
6
6
  "files": [