Skip to content

Commit

Permalink
check for truthiness of fieldname in receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Jun 7, 2024
1 parent 428654c commit 89fe00b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/modules/submission/receiver/receiver.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ export const configureMultipartReceiver = (
// (like Chinese, Tamil, etc), e.g.
// `utf8-with-endash – test.txt` -> `utf8-with-endash â�� test.txt`.
// See https://github.com/mscdex/busboy/issues/274.
if (!fieldname) {
logger.error({
message: 'Error while attempting to parse form fieldname',
meta: logMeta,
})
return reject(new MultipartContentParsingError())
}
const utf8Fieldname = Buffer.from(fieldname, 'latin1').toString('utf8')
if (filename) {
const buffers: Buffer[] = []
Expand Down

0 comments on commit 89fe00b

Please sign in to comment.