Skip to content

Commit

Permalink
Trim val before check
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Jun 17, 2021
1 parent e96c77a commit 95187e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/controllers/files.ts
Expand Up @@ -37,9 +37,9 @@ const multipartHandler = asyncHandler(async (req, res, next) => {
let fileCount = 0;

busboy.on('field', (fieldname: keyof File, val) => {
if (val === 'null') val = null;
if (val === 'false') val = false;
if (val === 'true') val = true;
if (typeof val === 'string' && val.trim() === 'null') val = null;
if (typeof val === 'string' && val.trim() === 'false') val = false;
if (typeof val === 'string' && val.trim() === 'true') val = true;

if (fieldname === 'storage') {
disk = val;
Expand Down

1 comment on commit 95187e1

@aidenfoxx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it should do the trick! 😄

Please sign in to comment.