-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
Description
Describe the bug
Node.js version: v16.20.1
OS version: macOS 13.5.1
Description: the app crashes when attempting to read a file larger than 2GB.. setting config.buffer false.
Actual behavior
a file larger than 2GB located in the /public directory can cause the entire app to crash when attempting to read it.
Expected behavior
reading it normally.
Code to reproduce
const Koa = require("koa");
const path = require("path");
const staticCache = require("koa-static-cache");
const app = new Koa();
app.use(
staticCache(path.join(__dirname, "public"), {
buffer: false,
dynamic: true,
preload: false,
})
);
app.use(async (ctx) => {
ctx.body = "Hello World";
});
app.listen(3000);Checklist
- I have searched through GitHub issues for similar issues.
- I have completely read through the README and documentation.
- I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.
Other
I suspect the issue may be related to the loadFile function:
