diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala index 8d9559836..d123043cc 100644 --- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala +++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala @@ -663,7 +663,7 @@ object HttpEntity { private var bytesLeft = Long.MaxValue override def preStart(): Unit = { - _attributes.getFirst[SizeLimit] match { + _attributes.get[SizeLimit] match { case Some(limit: SizeLimit) if limit.isDisabled => // "no limit" case Some(SizeLimit(bytes, cl @ Some(contentLength))) =>