playframework / playframework/play1

POST Request Body is limited to 8192

Open
#1,163 3 comments 0 reactions 1 assignee View on GitHub

@asolntsev is already working on this.

Since Jun 11, 2017.

Dominant language
Java
Stars
1.6k
Forks
671
Avg merge
12d 15h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.