🐛 BUG: @astrojs/netlify/functions
doesn't support base64 encoded responses
#3586
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
feat: ssr
Related to SSR (scope)
What version of
astro
are you using?1.0.0-beta.44
Are you using an SSR adapter? If so, which one?
Netlify
What package manager are you using?
pnpm
What operating system are you using?
Mac
Describe the Bug
Netlify Functions requires that the function's
body
is a string. To support certain use cases like returning aBuffer
for an image, the response needs to be base64 encoded and include theisBase64Encoded
flag@astrojs/netlify/functions
currently only supports text responses and doesn't have a way to use theisBase64Encoded
flagPossible Solutions
This is a tricky one since API endpoints only return a standard
Response
object. For Netlify, it could potentially check ifresponse.body
is a string, and if not assume it needs to be base64 encodedAnother option would be adding a custom header in the endpoint
Response
, but that could be a little weird since it really is adapter specificLink to Minimal Reproducible Example
na
Participation
The text was updated successfully, but these errors were encountered: