From 87956c1c144dc6a1e5298f3b63986671f6f2b7f3 Mon Sep 17 00:00:00 2001 From: Ives van Hoorne Date: Thu, 11 Apr 2024 11:24:10 +0000 Subject: [PATCH] fix(define): don't camelize files --- packages/git-extractor/src/middleware/camelize.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/git-extractor/src/middleware/camelize.ts b/packages/git-extractor/src/middleware/camelize.ts index 7e2f01b2..39ce3c2d 100644 --- a/packages/git-extractor/src/middleware/camelize.ts +++ b/packages/git-extractor/src/middleware/camelize.ts @@ -3,7 +3,14 @@ import { camelizeKeys } from "humps"; const camelizeMiddleware = async (ctx: Context, next: () => Promise) => { if (ctx.request.body) { + const originalBody = ctx.request.body; ctx.request.body = camelizeKeys(ctx.request.body); + + // Don't camelize files object, because there will be paths + // with underscores and it's user input. + if (ctx.request.body.files) { + ctx.request.body.files = originalBody.files; + } } await next();