Skip to content

Updates API Gateway but PNG images are still base64 encoded. #33

Description

@richburdon

The plugin successfully updates the API Gateway's binary support types, but when I try to serve PNG files from aws-serverless-express I'm still getting base64 encoded data returned from:

  app.use('/static', express.static(ENV.STATIC_DIR));

If I explicitly add an accept header with image/png then the correct image data is returned, but I can't do that from an <img/> tag.

Any suggestions? (seems like a popular issue):

https://forum.serverless.com/t/returning-binary-data-jpg-from-lambda-via-api-gateway/796
https://forum.serverless.com/t/force-return-of-binary-response-ignoring-accept-header/1299
#33
CodeGenieApp/serverless-express#39
CodeGenieApp/serverless-express#99
CodeGenieApp/serverless-express#104

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions