scotty icon indicating copy to clipboard operation
scotty copied to clipboard

(#396) Fixed unwated behaviour of files and filesOpts while not uploading file.

Open tusharad opened this issue 1 year ago • 2 comments

Please visit issue #396 for more details.

Issue

When using files or filesOpts function, upon not uploading any file, these function would still return a list of tuples containing filename as "\"\"" and fileContent as "\"\"".

Solution

  • I added a filter function right after the parseRequestBodyExBS which converts the body into the list of FileInfo type, that will remove any file whose filename is "\"\"".
  • I added the entry in changelog.md under breaking changes as well.

Thanks.

tusharad avatar Apr 29 '24 08:04 tusharad

@ocramz, I have added the test-cases.

tusharad avatar Apr 30 '24 07:04 tusharad

@tusharad since this change would break users of many versions of scotty (for good or worse: users will rely on every observable feature of a software), maybe it's a good idea to review how other web frameworks behave with empty files input.

ocramz avatar May 02 '24 16:05 ocramz