Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contentHandling #1752

Open
ianbale opened this issue Jan 16, 2024 · 0 comments
Open

contentHandling #1752

ianbale opened this issue Jan 16, 2024 · 0 comments

Comments

@ianbale
Copy link

ianbale commented Jan 16, 2024

Bug Report

Current Behavior

serverless-offline is looking for contentHandling in the wrong place.

It used to be located events:http:contentHandling when we used serverless-apigwy-binary

However it has been moved to events:http:response:contentHandling now that it is natively supported within serverless.

In order to make it work both offline and when deployed I have to double up the configuration as shown below:
However, this results in a warning when deploying:

Warning: Invalid configuration encountered
at 'functions.getApplePass.events.0.http': unrecognized property 'contentHandling'

  • file: serverless.yml

functions:
getApplePass:
handler: apple/handler.getApplePass
memorySize: 128
timeout : 30
events:
- http:
path: /{version}/passes/{passTypeIdentifier}/{serialNumber}
integration: lambda
contentHandling: CONVERT_TO_BINARY
method: get
cors: true
private: false
request:
parameters:
paths:
version: true
passTypeIdentifier: true
serialNumber: true
response:
contentHandling: CONVERT_TO_BINARY
headers:
Access-Control-Allow-Origin : "'*'"
Content-Type: "'application/vnd.apple.pkpass'"

plugins:

  • serverless-offline

provider:
runtime: nodejs18.x
stage: prod

Expected behavior/code

Environment

  • serverless version: 13.3.0
  • serverless-offline version: 13.3.0
  • node.js version: 8x
  • OS: Mac OS 13.6.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant