Skip to content

Commit ced1ff4

Browse files
authored
Improve too large chunk size test (apache#529)
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.
1 parent ab1b252 commit ced1ff4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

http-core/src/test/scala/org/apache/pekko/http/impl/engine/parsing/RequestParserSpec.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,11 +544,11 @@ abstract class RequestParserSpec(mode: String, newLine: String) extends AnyFreeS
544544
"too-large chunk size" in new Test {
545545
Seq(
546546
start,
547-
"""400000
547+
"""1400000
548548
|""") should generalMultiParseTo(
549549
Right(baseRequest),
550550
Left(
551-
EntityStreamError(ErrorInfo("HTTP chunk of 4194304 bytes exceeds the configured limit of 1048576 bytes"))))
551+
EntityStreamError(ErrorInfo("HTTP chunk of 20971520 bytes exceeds the configured limit of 1048576 bytes"))))
552552
closeAfterResponseCompletion shouldEqual Seq(false)
553553
}
554554

0 commit comments

Comments
 (0)