diff --git a/server/index.ts b/server/index.ts index 24e75980..02dd0fdb 100644 --- a/server/index.ts +++ b/server/index.ts @@ -8,6 +8,13 @@ import { randomUUID, createHash, createVerify } from "crypto"; export function createServer() { const app = express(); + // Middleware - capture raw body for Discord signature verification + app.use((req, res, buf, encoding) => { + if (buf && buf.length) { + req.rawBody = buf.toString(encoding || 'utf8'); + } + }); + // Middleware app.use(cors()); app.use(express.json());