Add Multipart support for fields#11
Conversation
|
Thanks very much for this! Would you be able to add a test which fails without, and passes with, your new addition? The existing test |
|
I think this issue only arises only if the request is actually multipart (mixed validatable form data and files). In those cases, Anyway, I have no idea how to fake an actual multipart request. I'd have to fake a real browser, and send a real file via a multipart form, or at least use internal Vapor APIs to join request slices together. |
|
Ping :) |
|
Sorry mate. PR #10 has added broken dependencies which caused the build to start failing and I have avoided making any further changes to this repo until Vapor 2 is out. If you need this in the meantime, could you manage by pointing to your own fork? |
I was trying to use vapor-forms in a multipart post request, using it for everything except the actual uploaded file (handled that on my own).
I don't know why, but if the form is posted as multipart, none of the fieldset parsers actually see any content.
content[fieldName] as? Nodereturns nil.But somehow,
content[fieldName]?.stringreturns a valid string.This PR checks for that form of parsing as well.