You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It worked a good portion of the time and then would just stop working even with the same requests.
See the issue is that Undertow will appear to randomly decide which fields become files. It does not appear to always be by request length but rather some other criteria that I'm unsure of.
So if you have a large plain text box form() may have the field in form().files() !
@jknack I am not sure if this is a bug (hence the discussion). It makes sense but I think Undertow thinks of multipart files as just bigger form fields whereas other frameworks do some content-disposition parsing for actual files.
Consequently a real toMultiMap would look like:
@SuppressWarnings("null")
Map<String, List<String>> formMultimap = form.toMultimap();
/* * Undertow will randomly decide what fields get turned into a file. Its * completely unclear how it makes that decision but my guess is it is * based on some pool. * * Thus we must extract the contents of multipart fields that have * become temp files. */varfiles = form.files();
if (!files.isEmpty()) {
formMultimap = newLinkedHashMap<String, List<String>>(formMultimap);
for (varf : files) {
Stringkey = f.getName();
// should check size to not blow up heap.Stringvalue = newString(f.bytes(), java.nio.charset.StandardCharsets.UTF_8);
formMultimap.put(key, List.of(value));
}
}
returnformMultimap;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
We were doing:
It worked a good portion of the time and then would just stop working even with the same requests.
See the issue is that Undertow will appear to randomly decide which fields become files. It does not appear to always be by request length but rather some other criteria that I'm unsure of.
So if you have a large plain text box form() may have the field in form().files() !
@jknack I am not sure if this is a bug (hence the discussion). It makes sense but I think Undertow thinks of multipart files as just bigger form fields whereas other frameworks do some content-disposition parsing for actual files.
Consequently a real toMultiMap would look like:
All reactions