You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the very exact bug as reported in #1107, which was closed as resolved, but it doesn't look like it is.
A very simple configutation setting in the request that it converts the payload to base64 (contentHandling: CONVERT_TO_TEXT) is not converting the body to base64, eo event.payload is not the expected base64-encoded data.
"use strict"const{ stringify }=JSONexports.hello=asyncfunctionhello(event){// event.payload should be encoded as base64return{body: stringify({foo: "bar"}),statusCode: 200,}}
Expected behavior/code
event.payload should be encoded as base64 when contentHandling is set to CONVERT_TO_TEXT
Bug Report
This is the very exact bug as reported in #1107, which was closed as resolved, but it doesn't look like it is.
A very simple configutation setting in the request that it converts the payload to base64 (
contentHandling: CONVERT_TO_TEXT
) is not converting the body to base64, eoevent.payload
is not the expected base64-encoded data.Current Behavior
Sample Code
Expected behavior/code
event.payload should be encoded as base64 when contentHandling is set to CONVERT_TO_TEXT
Environment
serverless
version: v3.38.0serverless-offline
version: v13.3.3node.js
version: v18.3.0OS
: Ubuntu 20.04Possible Solution
I think the error is in the HttpServer
serverless-offline/src/events/alb/HttpServer.js
Line 176 in c85a192
detectEncoding only returns either
utf8
orbinary
, but it should bebase64
for request contentHandling set to CONVERT_TO_TEXTThe text was updated successfully, but these errors were encountered: