Unexpected end of Stream when uploading to aspnet core

Update, this doesn’t work:

app.Use(next => context => {
context.Request.EnableRewind();

return next(context);
});