mirror of
https://github.com/kyantech/Palmr.git
synced 2025-10-22 22:02:00 +00:00
Fix empty .txt file uploads by preventing stream consumption
Co-authored-by: danielalves96 <62755605+danielalves96@users.noreply.github.com>
This commit is contained in:
@@ -6,12 +6,12 @@ import { FilesystemController } from "./controller";
|
||||
export async function filesystemRoutes(app: FastifyInstance) {
|
||||
const filesystemController = new FilesystemController();
|
||||
|
||||
app.addContentTypeParser("*", async (request: FastifyRequest, payload: any) => {
|
||||
return payload;
|
||||
app.addContentTypeParser("*", (request: FastifyRequest, payload: any, done: any) => {
|
||||
done(null, null);
|
||||
});
|
||||
|
||||
app.addContentTypeParser("application/json", async (request: FastifyRequest, payload: any) => {
|
||||
return payload;
|
||||
app.addContentTypeParser("application/json", (request: FastifyRequest, payload: any, done: any) => {
|
||||
done(null, null);
|
||||
});
|
||||
|
||||
app.put(
|
||||
|
Reference in New Issue
Block a user