Skip to content

Commit

Permalink
fix(define): don't camelize files
Browse files Browse the repository at this point in the history
  • Loading branch information
CompuIves committed Apr 11, 2024
1 parent f509c2d commit 87956c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/git-extractor/src/middleware/camelize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { camelizeKeys } from "humps";

const camelizeMiddleware = async (ctx: Context, next: () => Promise<any>) => {
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();
Expand Down

0 comments on commit 87956c1

Please sign in to comment.