scotty-web / scotty

Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
http://hackage.haskell.org/package/scotty
BSD 3-Clause "New" or "Revised" License
1.71k stars 132 forks source link

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

Open tusharad opened 2 months ago

tusharad commented 2 months ago

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

Thanks.

tusharad commented 2 months ago

@ocramz, I have added the test-cases.

ocramz commented 2 months ago

@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.