Skip to content

Commit 9be9080

Browse files
committed
fix: #86ew03681 Disable signature check for file uploads to prevent 412 errors
- Added logic to disable the signature check for POST requests to the /file endpoint, addressing issues with proxy body modification that resulted in 412 errors during file uploads. - Commented out the logging of headers for cleaner output during debugging.
1 parent d00b750 commit 9be9080

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

server/src/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ const restConfig: any = {
4040

4141
// Log requests for debugging
4242
app.use(async (ctx: any, next: any) => {
43+
// Disable signature check for file uploads to avoid 412 errors from proxy body modification
44+
if (ctx.path.endsWith("/file") && ctx.method === "POST") {
45+
ctx.disableSignatureCheck = true;
46+
}
47+
4348
if (ctx.path.includes("file") || ctx.method === "POST") {
4449
console.log(`[DEBUG] ${ctx.method} ${ctx.url}`);
45-
console.log(`[DEBUG] Headers:`, JSON.stringify(ctx.headers, null, 2));
50+
// console.log(`[DEBUG] Headers:`, JSON.stringify(ctx.headers, null, 2));
4651
}
4752
await next();
4853
});

0 commit comments

Comments
 (0)