diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RangeDirectivesSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RangeDirectivesSpec.scala index dc678809ef..fb4aca5a37 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RangeDirectivesSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/RangeDirectivesSpec.scala @@ -78,13 +78,13 @@ class RangeDirectivesSpec extends RoutingSpec with Inspectors with Inside { "reject an unsatisfiable single range" in { Get() ~> addHeader(Range(ByteRange(100, 200))) ~> completeWithRangedBytes(10) ~> check { - rejection shouldEqual UnsatisfiableRangeRejection(Seq(ByteRange(100, 200)), 10) + rejection shouldEqual UnsatisfiableRangeRejection(ByteRange(100, 200) :: Nil, 10) } } "reject an unsatisfiable single suffix range with length 0" in { Get() ~> addHeader(Range(ByteRange.suffix(0))) ~> completeWithRangedBytes(42) ~> check { - rejection shouldEqual UnsatisfiableRangeRejection(Seq(ByteRange.suffix(0)), 42) + rejection shouldEqual UnsatisfiableRangeRejection(ByteRange.suffix(0) :: Nil, 42) } } diff --git a/akka-http/src/main/scala/akka/http/scaladsl/server/Rejection.scala b/akka-http/src/main/scala/akka/http/scaladsl/server/Rejection.scala index 95db843ece..44a3b5808f 100644 --- a/akka-http/src/main/scala/akka/http/scaladsl/server/Rejection.scala +++ b/akka-http/src/main/scala/akka/http/scaladsl/server/Rejection.scala @@ -70,7 +70,7 @@ case class MalformedHeaderRejection(headerName: String, errorMsg: String, * Rejection created by unmarshallers. * Signals that the request was rejected because the requests content-type is unsupported. */ -case class UnsupportedRequestContentTypeRejection(supported: Set[ContentTypeRange]) extends Rejection +case class UnsupportedRequestContentTypeRejection(supported: immutable.Set[ContentTypeRange]) extends Rejection /** * Rejection created by decoding filters. @@ -83,7 +83,7 @@ case class UnsupportedRequestEncodingRejection(supported: HttpEncoding) extends * Signals that the request was rejected because the requests contains only unsatisfiable ByteRanges. * The actualEntityLength gives the client a hint to create satisfiable ByteRanges. */ -case class UnsatisfiableRangeRejection(unsatisfiableRanges: Seq[ByteRange], actualEntityLength: Long) extends Rejection +case class UnsatisfiableRangeRejection(unsatisfiableRanges: immutable.Seq[ByteRange], actualEntityLength: Long) extends Rejection /** * Rejection created by range directives. @@ -112,14 +112,14 @@ case object RequestEntityExpectedRejection extends Rejection * Signals that the request was rejected because the service is not capable of producing a response entity whose * content type is accepted by the client */ -case class UnacceptedResponseContentTypeRejection(supported: Set[ContentType]) extends Rejection +case class UnacceptedResponseContentTypeRejection(supported: immutable.Set[ContentType]) extends Rejection /** * Rejection created by encoding filters. * Signals that the request was rejected because the service is not capable of producing a response entity whose * content encoding is accepted by the client */ -case class UnacceptedResponseEncodingRejection(supported: Set[HttpEncoding]) extends Rejection +case class UnacceptedResponseEncodingRejection(supported: immutable.Set[HttpEncoding]) extends Rejection object UnacceptedResponseEncodingRejection { def apply(supported: HttpEncoding): UnacceptedResponseEncodingRejection = UnacceptedResponseEncodingRejection(Set(supported)) } diff --git a/akka-http/src/main/scala/akka/http/scaladsl/server/directives/RangeDirectives.scala b/akka-http/src/main/scala/akka/http/scaladsl/server/directives/RangeDirectives.scala index 53aea321e4..09bca74261 100644 --- a/akka-http/src/main/scala/akka/http/scaladsl/server/directives/RangeDirectives.scala +++ b/akka-http/src/main/scala/akka/http/scaladsl/server/directives/RangeDirectives.scala @@ -97,7 +97,7 @@ trait RangeDirectives { case _ ⇒ None } - def applyRanges(ranges: Seq[ByteRange]): Directive0 = + def applyRanges(ranges: immutable.Seq[ByteRange]): Directive0 = extractRequestContext.flatMap { ctx ⇒ mapRouteResultWithPF { case Complete(HttpResponse(OK, headers, entity, protocol)) ⇒