Skip to content

Commit

Permalink
Improve too large chunk size test (apache#529)
Browse files Browse the repository at this point in the history
The current test goes over the configured max chunk size when parsing
the last hex char. The spirit of the code is to continue parsing the
size even if we've already gone over the max chunk size. To actually
test this we need to make sure another char follows after we've gone
over the max chunk size.
  • Loading branch information
SkyTrix authored Apr 2, 2024
1 parent ab1b252 commit ced1ff4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,11 +544,11 @@ abstract class RequestParserSpec(mode: String, newLine: String) extends AnyFreeS
"too-large chunk size" in new Test {
Seq(
start,
"""400000
"""1400000
|""") should generalMultiParseTo(
Right(baseRequest),
Left(
EntityStreamError(ErrorInfo("HTTP chunk of 4194304 bytes exceeds the configured limit of 1048576 bytes"))))
EntityStreamError(ErrorInfo("HTTP chunk of 20971520 bytes exceeds the configured limit of 1048576 bytes"))))
closeAfterResponseCompletion shouldEqual Seq(false)
}

Expand Down

0 comments on commit ced1ff4

Please sign in to comment.