perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.64k stars 1.56k forks source link

Multipart parameters #954

Open saantiaguilera opened 6 years ago

saantiaguilera commented 6 years ago

If using jetty, we can simply add the org.eclipse.jetty.multipartConfig attribute and we will have in the #queryParams our multiparts strings.

If using tomcat, we dont need to add the attribute but we have to add to the catalina context the allowCasualMultipartParsing=true. Yet, Spark will only add our multiparts strings to the #queryParams in POST ops. If we do a PUT / PATCH (which also support multipart...) we dont have them and we have to retrieve them from the raw parts on our own.

This is not any serious bug, since parsing the byte content is really easy, but its a weird behavior (some operations parse them and others dont)

Could we have this standarized ? I mean, either the dev has to parse the content in all operations, or spark automatically parses them in all operations.