Should filename be treated as optional in Multipart requests #12844
Replies: 2 comments
-
Looking at the code, I am thinking about, is it even ok, regarding to the specs, to allow |
Beta Was this translation helpful? Give feedback.
-
Actually, it's probably not possible to do anything about this. I only see that And without In theory, it may be possible to check the Content-Types of the parts - e.g. treat But this won't help with the cases we've seen where obviously binary data is provided without a filename, but also without a Content-Type - which I understand from the spec should default to text/plain. I think for our use-case we may need a custom |
Beta Was this translation helpful? Give feedback.
-
We regularly see requests with file dispositions without filenames.
We have not identified exactly what is creating requests like this, but the specification for multipart/form-data says
However, the multipart parser in playframework will treat a file disposition without a filename as a regular data part.
It's a bit awkward to have to work with dataParts as well as fileParts. But probably a more important implication of this, is that the whole file content is loaded into memory, and files that exceed the
play.http.parser.maxMemoryBuffer
setting are rejected with a413
(rather writing to disk and accepting up to theplay.http.parser.maxDiskBuffer
).I wonder if the filename should be optional on the FilePart and all file dispositions should be treated as FileParts.
Beta Was this translation helpful? Give feedback.
All reactions