Premature connection closed
ekasetiawans opened this issue · comments
Calling this
await for (final part in req.multipartFormData) {
// whatever
}
sometimes caused premature connection closed a.k.a Connection was closed before full header received.
To fix that, I using this way
final parts = await req.multipartFormData.toList();
for (final part in parts) {
// whatever
}
Where do you get the exception, on the client or on the server? Are you behind a reverse proxy? Using the await for
syntax will pause the incoming stream while you're handling some part entries, but that shouldn't be a problem in most cases.
@simolus3 I got exception on the client and yes my server application is behind reverse proxy.