Closed ahmed-sharief5 closed 2 years ago
thank you for filing the the issue @ahmed-sharief5
could you create a PR with your fix?
@dnalborczyk I had created the pull request #1581
fixed in: https://github.com/dherault/serverless-offline/pull/1581
released in v10.3.0
Bug Report
serverless-offline 10.1.0 fails when the --disableCookieValidation flag is used with HTTP API (AWS) with payload 2.0.
Current Behavior
It throws internal server error with the following error
Debug: internal, implementation, error TypeError: Cannot convert undefined or null to object at entries (<anonymous>) at LambdaProxyIntegrationEventV2.create
Sample Code
Expected behavior/code
Its should return a success response
Environment
serverless
serverless-offline
version: 10.1.0node.js
version: 16.17.0OS
: macOS 12.4Expected behavior/code
Handle the below code
const cookies = entries(this.#request.state).flatMap(([key, value]) => { if (isArray(value)) { return value.map((v) =>
${key}=${v}) } return
${key}=${value}})
with this resolves the disable cookie validation
const cookies = this.#request.state ? entries(this.#request.state).flatMap(([key, value]) => { if (isArray(value)) { return value.map((v) =>
${key}=${v}) } return
${key}=${value}}) : ""