Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Partinfo field "partFileName" is a Maybe, but is never Nothing? #159

Open
amontague opened this Issue · 3 comments

3 participants

amontague Daniel Patterson Gregory Collins
amontague

When you submit a form that contains a file input element, and have not selected a file, you get a PartInfo containing: partFileName = Just "" instead of Nothing.

Daniel Patterson
Collaborator

I just ran into this, and it seems very wrong... This issue has obviously been open for a while - is there a specific design reason for this, or is it a bug (that should be fixed)?

Gregory Collins

It's probably a bug -- please send a minimal server exhibiting the problem along with instructions for reproduction.

Daniel Patterson dbp referenced this issue from a commit in dbp/snap-upload-blank-example
Daniel Patterson dbp commit of example demonstrating issue snapframework/snap-core#159 5e35c7e
Daniel Patterson
Collaborator

@gregorycollins Here's a repository containing a server that exhibits the problem:

https://github.com/dbp/snap-upload-blank-example

To reproduce, build and run the server, then visit the index, and hit submit without setting a file. It will print, to the console:

PartInfo {partFieldName = "f", partFileName = Just "", partContentType = "application/octet-stream"}

Which I believe should instead be:

PartInfo {partFieldName = "f", partFileName = Nothing, partContentType = "application/octet-stream"}
Daniel Patterson dbp referenced this issue from a commit in positioncoop/digestive-functors
Daniel Patterson dbp workaround for issue snapframework/snap-core#159 54ae81b
Daniel Patterson dbp referenced this issue from a commit in positioncoop/digestive-functors
Daniel Patterson dbp workaround for issue snapframework/snap-core#159 12c88e5
Daniel Patterson dbp referenced this issue from a commit in positioncoop/digestive-functors
Daniel Patterson dbp workaround for issue snapframework/snap-core#159 16ecfde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.