-
Notifications
You must be signed in to change notification settings - Fork 33
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
How to prevent application/json being transformed into base64 #47
Comments
I also have this same question. |
That was just a lack of understanding on my part.
|
@brian-fivetalent did setting a specific type work for you in the end? I'm having the same problem even if i use: |
Same here, no matter what I list everything gets the CONVERT_TO_BINARY. Kind of annoying since I don't want my error messages to be mp3s :-) |
fcking serverlesss of st I can't download f*cking file!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
Same issue, and doing below does NOT resolve: apigwBinary:
types:
- 'image/png' # or any other format |
After some fiddling around, I was able to resolve this issue. Here are my findings:
Here is how my serverless.yml is setup with the plugin: ...
plugins:
- serverless-webpack
- serverless-deployment-bucket
- serverless-apigateway-service-proxy
- serverless-apigw-binary
- serverless-offline
custom:
apigwBinary:
types:
# Only add Content-Types here that you want to convert as Binary.
# Note, this will happen for ALL end-points.
# Don't add */* or else it will convert all paths and functons' requests to binary.
- 'multipart/form-data'
functions:
myFunction:
handler: src/infra/http/index.myFunction
events:
- http:
path: myPath
method: post
cors: true
request:
parameters:
paths:
myPathParam: true I am only using Hope this helps! |
I have a serverless app which uploads files to s3 (via POST request) and serves them (via GET request)
In order to upload an image the POST endpoint takes a body like { "base64": "..." }. However with this configuration the entire body is coming through as a base64 encoded string. How can I prevent the request body with
application/json
being transformed?See
serverless.yml
below:This is a clone of (https://stackoverflow.com/questions/52479994/serverless-api-gateway-transforming-request-into-base64) but no response as of yet...
The text was updated successfully, but these errors were encountered: