Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Post large body cause model mark with [FromBody] become null #6568

Closed
303248153 opened this issue Jul 20, 2017 · 2 comments
Closed

Post large body cause model mark with [FromBody] become null #6568

303248153 opened this issue Jul 20, 2017 · 2 comments

Comments

@303248153
Copy link

Refer to #6055 and aspnet/KestrelHttpServer#1877,

I hava a webapi method like this:

[HttpPost]
public async Task<OutModel> Post([FromBody]Model model)
{
	var id = await _service.Handle(model);
	return new OutModel(id);
}

When I post a 30MB json body, model become null without any hints and kestrel report "Request body too large" in logs.
I think #6055 is a bad change because it make people doesn't know what's really happening.

@rynowak
Copy link
Member

rynowak commented Jul 20, 2017

/cc @Eilon - #4920 strikes again

@Eilon
Copy link
Member

Eilon commented Aug 9, 2017

This is essentially a dup of #4920, the other links bugs mentioned earlier are unlikely to be related.

Kestrel is throwing an exception when the post is greater than the configured limit, and MVC is unfortunately hiding the exception. In #4920 we'll make these types of exceptions more obvious by default.

@Eilon Eilon closed this as completed Aug 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants