play1 icon indicating copy to clipboard operation
play1 copied to clipboard

POST Request Body is limited to 8192

Open jaesga opened this issue 8 years ago • 3 comments

Hi,

I have encountered some problems while making POST Request to my Play! application. If the body lenght is greater than 8192 the following exception is thrown if I use the request.body InputStream after closing it:

Oops: IOException
Unexpected error : Unexpected Error, caused by exception IOException: Stream Closed

play.exceptions.UnexpectedException: Unexpected Error
	at play.data.parsing.TextParser.parse(TextParser.java:25)
	at play.mvc.Scope$Params.checkAndParse(Scope.java:380)
	at play.mvc.Scope$Params.all(Scope.java:474)
	at play.mvc.ActionInvoker.getActionMethodArgs(ActionInvoker.java:625)
	at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:450)
	at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:436)
	at play.mvc.ActionInvoker.handleBefores(ActionInvoker.java:299)
	at play.mvc.ActionInvoker.invoke(ActionInvoker.java:144)
	at Invocation.HTTP Request(Play!)
Caused by: java.io.IOException: Stream Closed
	at java.io.FileInputStream.read0(Native Method)
	at java.io.FileInputStream.read(FileInputStream.java:207)
	at play.data.parsing.TextParser.parse(TextParser.java:18)
	... 8 more

I think this is caused because by default the maxChunkSize of HttpRequestDecoder from netty is 8192.

Does it make sense to make this a config value or increase with a higher value?

Regards.

jaesga avatar Jun 08 '17 16:06 jaesga

@jaesga Yes, certainly it could be configurable. Can you prepare a pull request for fixing this issue?

asolntsev avatar Jun 11 '17 20:06 asolntsev

@jaesga Hi! Is the problem still actual? Can we close the issue?

asolntsev avatar Oct 12 '17 20:10 asolntsev

Yes the problem still exist for long url

xael-fry avatar Oct 13 '17 07:10 xael-fry