aws-lambda-fastify
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -17,2 +17,3 @@ import { Context } from "aws-lambda"; | ||
isBase64Encoded: boolean; | ||
cookies?: string[] | ||
} | ||
@@ -19,0 +20,0 @@ |
11
index.js
@@ -93,8 +93,9 @@ module.exports = (app, options) => { | ||
let multiValueHeaders | ||
let cookies | ||
Object.keys(res.headers).forEach((h) => { | ||
const isSetCookie = h.toLowerCase() === 'set-cookie' | ||
if (Array.isArray(res.headers[h])) { | ||
if (h.toLowerCase() === 'set-cookie') { | ||
if (isSetCookie) { | ||
multiValueHeaders = multiValueHeaders || {} | ||
multiValueHeaders[h] = res.headers[h] | ||
delete res.headers[h] | ||
} else res.headers[h] = res.headers[h].join(',') | ||
@@ -105,2 +106,6 @@ } else if (typeof res.headers[h] !== 'undefined' && typeof res.headers[h] !== 'string') { | ||
} | ||
if (isSetCookie) { | ||
cookies = Array.isArray(res.headers[h]) ? res.headers[h] : [res.headers[h]] | ||
delete res.headers[h] | ||
} | ||
}) | ||
@@ -117,2 +122,4 @@ | ||
} | ||
if (cookies) ret.cookies = cookies | ||
if (multiValueHeaders) ret.multiValueHeaders = multiValueHeaders | ||
@@ -119,0 +126,0 @@ resolve(ret) |
@@ -29,3 +29,3 @@ { | ||
"license": "MIT", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"main": "index.js", | ||
@@ -43,3 +43,3 @@ "scripts": { | ||
"benchmark": "^2.1.4", | ||
"eslint": "^8.10.0", | ||
"eslint": "^8.11.0", | ||
"eslint-config-standard": "^16.0.3", | ||
@@ -50,7 +50,7 @@ "eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-standard": "^5.0.0", | ||
"fastify": "^3.27.3", | ||
"fastify": "^3.27.4", | ||
"serverless-http": "^2.7.0", | ||
"tap": "^16.0.0", | ||
"tap": "^16.0.1", | ||
"tsd": "^0.19.1" | ||
} | ||
} |
@@ -10,3 +10,3 @@ # Introduction | ||
**No use of internal sockets, makes use of Fastify's [inject](https://www.fastify.io/docs/latest/Testing/#testing-with-http-injection) function.** | ||
**No use of internal sockets, makes use of Fastify's [inject](https://www.fastify.io/docs/latest/Guides/Testing/#testing-with-http-injection) function.** | ||
@@ -13,0 +13,0 @@ **Seems [faster](https://github.com/fastify/aws-lambda-fastify#some-basic-performance-metrics)** *(as the name implies)* **than [aws-serverless-express](https://github.com/awslabs/aws-serverless-express) and [aws-serverless-fastify](https://github.com/benMain/aws-serverless-fastify) 😉** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21199
214