Skip to content

both express.static and res.sendFile return wrong binary when serving a zip file #677

Open
@yspreen

Description

@yspreen

I'm not using any middleware except express.json and cors.

this is lambda.ts

import serverlessExpress from "@codegenie/serverless-express";
import app from "./app";
exports.handler = serverlessExpress({
  app,
  binaryMimeTypes: ["application/x-zip", "application/zip"],
});

I tried with and without specifying binaryMimeTypes and with and without the specific first route:

app.use("/done/ext.zip", (req, res) => {
  res.sendFile(path.join(__dirname, "public/ext.zip"));
});
app.use("/done", express.static("public"));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions