From ced1ff41137080d1d567969c3759e7ce99915463 Mon Sep 17 00:00:00 2001 From: Cedric Vandendriessche Date: Tue, 2 Apr 2024 21:01:07 +0200 Subject: [PATCH] Improve too large chunk size test (#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. --- .../pekko/http/impl/engine/parsing/RequestParserSpec.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-core/src/test/scala/org/apache/pekko/http/impl/engine/parsing/RequestParserSpec.scala b/http-core/src/test/scala/org/apache/pekko/http/impl/engine/parsing/RequestParserSpec.scala index fbbbec7ba..96c092764 100644 --- a/http-core/src/test/scala/org/apache/pekko/http/impl/engine/parsing/RequestParserSpec.scala +++ b/http-core/src/test/scala/org/apache/pekko/http/impl/engine/parsing/RequestParserSpec.scala @@ -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) }