diff --git a/src/server/src/app/server.ts b/src/server/src/app/server.ts index acc4db1..299dbfb 100644 --- a/src/server/src/app/server.ts +++ b/src/server/src/app/server.ts @@ -94,6 +94,18 @@ export async function createApp() { const app = new Hono() .onError(errorHandler) + .use('*', async (c, next) => { + const ct = c.req.header('content-length'); + const te = c.req.header('transfer-encoding'); + if (ct || te) { + const method = c.req.method; + const path = c.req.path; + if (method !== 'GET') { + console.log(JSON.stringify({ ts: new Date().toISOString(), msg: 'pre_bodylimit', method, path, contentLength: ct, transferEncoding: te })); + } + } + await next(); + }) .use('*', bodyLimit({ maxSize: 100 * 1024 * 1024 })) // 100MB for large iMessage batch uploads .get('/health', (c) => c.json({ ok: true })) .get('/health/deep', async (c) => {