scotty
scotty copied to clipboard
(#396) Fixed unwated behaviour of files and filesOpts while not uploading file.
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
parseRequestBodyExBSwhich converts the body into the list of FileInfo type, that will remove any file whose filename is"\"\"". - I added the entry in
changelog.mdunderbreaking changesas well.
Thanks.
@ocramz, I have added the test-cases.
@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.