Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/main/paradox/common/marshalling.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ Specifically these are:
* @apidoc[StatusCode]
* `(StatusCode, T)`, if a `ToEntityMarshaller[T]` is available
* `(Int, T)`, if a `ToEntityMarshaller[T]` is available
* `(StatusCode, immutable.Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* `(Int, immutable.Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* `(StatusCode, Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* `(Int, Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* @scaladoc[PredefinedToRequestMarshallers](org.apache.pekko.http.scaladsl.marshalling.PredefinedToRequestMarshallers)
* @apidoc[HttpRequest]
* @apidoc[Uri]
* `(HttpMethod, Uri, T)`, if a `ToEntityMarshaller[T]` is available
* `(HttpMethod, Uri, immutable.Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* `(HttpMethod, Uri, Seq[HttpHeader], T)`, if a `ToEntityMarshaller[T]` is available
* @scaladoc[GenericMarshallers](org.apache.pekko.http.scaladsl.marshalling.GenericMarshallers)
* @apidoc[Marshaller[Throwable, T]]
* @apidoc[Marshaller[Option[A], B]], if a @apidoc[Marshaller[A, B]] and an `EmptyValue[B]` is available
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@
|@ref[logRequestResult](debugging-directives/logRequestResult.md) | Produces a log entry for every incoming request and @apidoc[RouteResult] |
|@ref[logResult](debugging-directives/logResult.md) | Produces a log entry for every @apidoc[RouteResult] |
|@ref[mapInnerRoute](basic-directives/mapInnerRoute.md) | Transforms its inner @scala[@scaladoc[Route](org.apache.pekko.http.scaladsl.server.index#Route=org.apache.pekko.http.scaladsl.server.RequestContext=%3Escala.concurrent.Future[org.apache.pekko.http.scaladsl.server.RouteResult])]@java[@javadoc[Route](org.apache.pekko.http.javadsl.server.Route)] with a @scala[`Route => Route`]@java[`UnaryOperator<Route>`] function |
|@ref[mapRejections](basic-directives/mapRejections.md) | Transforms rejections from a previous route with an @scala[`immutable.Seq[Rejection] => immutable.Seq[Rejection]`]@java[`UnaryOperator<List<Rejection>>`] function |
|@ref[mapRejections](basic-directives/mapRejections.md) | Transforms rejections from a previous route with an @scala[`Seq[Rejection] => Seq[Rejection]`]@java[`UnaryOperator<List<Rejection>>`] function |
|@ref[mapRequest](basic-directives/mapRequest.md) | Transforms the request with an @scala[`HttpRequest => HttpRequest`]@java[`UnaryOperator<HttpRequest>`] function |
|@ref[mapRequestContext](basic-directives/mapRequestContext.md) | Transforms the @apidoc[RequestContext] with a @scala[`RequestContext => RequestContext`]@java[`UnaryOperator<RequestContext>`] function |
|@ref[mapResponse](basic-directives/mapResponse.md) | Transforms the response with an @scala[`HttpResponse => HttpResponse`]@java[`UnaryOperator<HttpResponse>`] function |
|@ref[mapResponseEntity](basic-directives/mapResponseEntity.md) | Transforms the response entity with an @scala[`ResponseEntity => ResponseEntity`]@java[`UnaryOperator<ResponseEntity>`] function |
|@ref[mapResponseHeaders](basic-directives/mapResponseHeaders.md) | Transforms the response headers with an @scala[`immutable.Seq[HttpHeader] => immutable.Seq[HttpHeader]`]@java[`UnaryOperator<List<HttpHeader>>`] function |
|@ref[mapResponseHeaders](basic-directives/mapResponseHeaders.md) | Transforms the response headers with an @scala[`Seq[HttpHeader] => Seq[HttpHeader]`]@java[`UnaryOperator<List<HttpHeader>>`] function |
|@ref[mapRouteResult](basic-directives/mapRouteResult.md) | Transforms the @apidoc[RouteResult] with a @scala[`RouteResult => RouteResult`]@java[`UnaryOperator<RouteResult>`] function |
|@ref[mapRouteResultFuture](basic-directives/mapRouteResultFuture.md) | Transforms the @apidoc[RouteResult] future with a @scala[`Future[RouteResult] => Future[RouteResult]`]@java[`UnaryOperator<CompletionStage<RouteResult>>`] function |
|@ref[mapRouteResultPF](basic-directives/mapRouteResultPF.md) | Transforms the @apidoc[RouteResult] with a @scala[`PartialFunction[RouteResult, RouteResult]`]@java[`PartialFunction<RouteResult, RouteResult>`] |
Expand Down Expand Up @@ -130,8 +130,8 @@
|@ref[query](method-directives/query.md) | Rejects all non-QUERY requests |
|@ref[rawPathPrefix](path-directives/rawPathPrefix.md) | Applies the given matcher directly to a prefix of the unmatched path of the @apidoc[RequestContext], without implicitly consuming a leading slash |
|@ref[rawPathPrefixTest](path-directives/rawPathPrefixTest.md) | Checks whether the unmatchedPath has a prefix matched by the given `PathMatcher` |
|@ref[recoverRejections](basic-directives/recoverRejections.md) | Transforms rejections from the inner route with an @scala[`immutable.Seq[Rejection] => RouteResult`]@java[`Function<List<Rejection>, RouteResult>`] function |
|@ref[recoverRejectionsWith](basic-directives/recoverRejectionsWith.md) | Transforms rejections from the inner route with an @scala[`immutable.Seq[Rejection] => Future[RouteResult]`]@java[`Function<List<Rejection], CompletionStage<RouteResult>>`] function |
|@ref[recoverRejections](basic-directives/recoverRejections.md) | Transforms rejections from the inner route with an @scala[`Seq[Rejection] => RouteResult`]@java[`Function<List<Rejection>, RouteResult>`] function |
|@ref[recoverRejectionsWith](basic-directives/recoverRejectionsWith.md) | Transforms rejections from the inner route with an @scala[`Seq[Rejection] => Future[RouteResult]`]@java[`Function<List<Rejection], CompletionStage<RouteResult>>`] function |
|@ref[redirect](route-directives/redirect.md) | Completes the request with redirection response of the given type to the given URI |
|@ref[redirectToNoTrailingSlashIfPresent](path-directives/redirectToNoTrailingSlashIfPresent.md) | If the request path ends with a slash, redirects to the same URI without trailing slash in the path |
|@ref[redirectToTrailingSlashIfMissing](path-directives/redirectToTrailingSlashIfMissing.md) | If the request path doesn't end with a slash, redirects to the same URI with trailing slash in the path |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
want to try the @ref[handleRejections](../execution-directives/handleRejections.md) directive which provides a nicer DSL for building rejection handlers.

Transforms rejections from the inner route with
@scala[an `immutable.Seq[Rejection] => RouteResult` function.]
@scala[an `Seq[Rejection] => RouteResult` function.]
@java[a `Function<Iterable<Rejection>, RouteResult>`.]
A @apidoc[RouteResult] is either a
@scala[`Complete(HttpResponse(...))`]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
**Low level directive** – unless you're sure you need to be working on this low-level you might instead
want to try the @ref[handleRejections](../execution-directives/handleRejections.md) directive which provides a nicer DSL for building rejection handlers.

Transforms rejections from the inner route with @scala[an `immutable.Seq[Rejection] => Future[RouteResult]` function]@java[a `Function<Iterable<Rejection>, CompletionStage<RouteResult>>`].
Transforms rejections from the inner route with @scala[an `Seq[Rejection] => Future[RouteResult]` function]@java[a `Function<Iterable<Rejection>, CompletionStage<RouteResult>>`].

Asynchronous version of @ref[recoverRejections](recoverRejections.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/routing-dsl/rejections.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ you can attach handling logic for certain types of rejections through three help
run when the rejection is "caught". This makes the full power of the Routing DSL available for defining rejection
handlers and even allows for recursing back into the main route structure if required.

@scala[handleAll[T <: Rejection: ClassTag](f: immutable.Seq[T] => Route)]@java[handleAll<T extends Rejection>(Class<T>, Function<List<T>, Route>)]
@scala[handleAll[T <: Rejection: ClassTag](f: Seq[T] => Route)]@java[handleAll<T extends Rejection>(Class<T>, Function<List<T>, Route>)]
: Handles all rejections of a certain type at the same time. This is useful for cases where your need access to more
than the first rejection of a certain type, e.g. for producing the error message to an unsupported request method.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/main/paradox/routing-dsl/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sealed trait RouteResult

object RouteResult {
final case class Complete(response: HttpResponse) extends RouteResult
final case class Rejected(rejections: immutable.Seq[Rejection]) extends RouteResult
final case class Rejected(rejections: Seq[Rejection]) extends RouteResult
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import pekko.http.scaladsl.model.{ HttpEntity, HttpRequest }
import pekko.http.scaladsl.model.headers.{ Authorization, BasicHttpCredentials }
import pekko.testkit.PekkoSpec

import scala.collection.immutable

class HttpRequestDetailedStringExampleSpec extends PekkoSpec {

// Custom string representation which includes headers
Expand All @@ -38,7 +36,7 @@ class HttpRequestDetailedStringExampleSpec extends PekkoSpec {
"This body contains information about [user]"

val httpRequestWithHeadersAndBody =
HttpRequest(entity = piiBody, headers = immutable.Seq(piiHeader))
HttpRequest(entity = piiBody, headers = Seq(piiHeader))

// Our custom string representation includes body and headers string representations...
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import pekko.http.scaladsl.model.{ HttpEntity, HttpResponse }
import pekko.http.scaladsl.model.headers.{ Authorization, BasicHttpCredentials }
import pekko.testkit.PekkoSpec

import scala.collection.immutable

class HttpResponseDetailedStringExampleSpec extends PekkoSpec {

// Custom string representation which includes headers
Expand All @@ -38,7 +36,7 @@ class HttpResponseDetailedStringExampleSpec extends PekkoSpec {
"This body contains information about [user]"

val httpResponseWithHeadersAndBody =
HttpResponse(entity = piiBody, headers = immutable.Seq(piiHeader))
HttpResponse(entity = piiBody, headers = Seq(piiHeader))

// Our custom string representation includes body and headers string representations...
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class WebSocketClientExampleSpec extends AnyWordSpec with Matchers with CompileO
import pekko.http.scaladsl.model.ws._

implicit val system = ActorSystem()
import collection.immutable.Seq

val flow: Flow[Message, Message, NotUsed] =
Flow.fromSinkAndSource(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import pekko.http.impl.engine.http2.Http2Protocol.SettingIdentifier
import pekko.http.scaladsl.model.ErrorInfo
import pekko.util.ByteString

import scala.collection.immutable

/** INTERNAL API */
@InternalApi
private[http2] sealed trait FrameEvent { self: Product =>
Expand Down Expand Up @@ -78,8 +76,8 @@ private[http] object FrameEvent {
headerBlockFragment: ByteString) extends StreamFrameEvent

final case class RstStreamFrame(streamId: Int, errorCode: ErrorCode) extends StreamFrameEvent
final case class SettingsFrame(settings: immutable.Seq[Setting]) extends FrameEvent
final case class SettingsAckFrame(acked: immutable.Seq[Setting]) extends FrameEvent
final case class SettingsFrame(settings: Seq[Setting]) extends FrameEvent
final case class SettingsAckFrame(acked: Seq[Setting]) extends FrameEvent

case class PingFrame(ack: Boolean, data: ByteString) extends FrameEvent {
require(data.size == 8, s"PingFrame payload must be of size 8 but was ${data.size}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import pekko.annotation.InternalApi
import pekko.stream.scaladsl.{ BidiFlow, Flow }
import pekko.util.ByteString

import scala.collection.immutable.Seq
import FrameEvent._
import pekko.event.Logging
import pekko.stream.Attributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import pekko.util.ByteString
import pekko.Done

import javax.net.ssl.SSLEngine
import scala.collection.immutable
import scala.concurrent.{ ExecutionContext, Future }
import scala.concurrent.duration.Duration
import scala.util.control.NonFatal
Expand Down Expand Up @@ -199,7 +198,7 @@ private[http] final class Http2Ext(implicit val system: ActorSystem)

upgradeSettings match {
// Must be exactly one
case immutable.Seq(Success(settingsFromHeader)) =>
case Seq(Success(settingsFromHeader)) =>
// inject the actual upgrade request with a stream identifier of 1
// https://http2.github.io/http2-spec/#rfc.section.3.2
val injectedRequest = Source.single(req.addAttribute(Http2.streamId, 1))
Expand All @@ -217,11 +216,11 @@ private[http] final class Http2Ext(implicit val system: ActorSystem)
Future.successful(
HttpResponse(
StatusCodes.SwitchingProtocols,
immutable.Seq[HttpHeader](
Seq[HttpHeader](
ConnectionUpgradeHeader,
UpgradeHeader,
UpgradeToOtherProtocolResponseHeader(serverLayer))))
case immutable.Seq(Failure(e)) =>
case Seq(Failure(e)) =>
log.warning("Failed to parse http2-settings header in upgrade [{}], continuing with HTTP/1.1", e.getMessage)
handler(req)
// A server MUST NOT upgrade the connection to HTTP/2 if this header field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import pekko.util.Helpers.toRootLowerCase

import scala.concurrent.duration.{ Duration, FiniteDuration }
import scala.concurrent.{ ExecutionContext, Future }
import scala.collection.immutable
import scala.util.control.NonFatal

/**
Expand Down Expand Up @@ -130,7 +129,7 @@ private[http] object Http2Blueprint {
def serverStack(
settings: ServerSettings,
log: LoggingAdapter,
initialDemuxerSettings: immutable.Seq[Setting] = Nil,
initialDemuxerSettings: Seq[Setting] = Nil,
upgraded: Boolean = false,
telemetry: TelemetrySpi,
dateHeaderRendering: DateHeaderRendering): BidiFlow[HttpResponse, ByteString, ByteString, HttpRequest, ServerTerminator] = {
Expand Down Expand Up @@ -272,7 +271,7 @@ private[http] object Http2Blueprint {
* Creates substreams for every stream and manages stream state machines
* and handles priorization (TODO: later)
*/
def serverDemux(settings: Http2ServerSettings, initialDemuxerSettings: immutable.Seq[Setting], upgraded: Boolean)
def serverDemux(settings: Http2ServerSettings, initialDemuxerSettings: Seq[Setting], upgraded: Boolean)
: BidiFlow[Http2SubStream, FrameEvent, FrameEvent, Http2SubStream, ServerTerminator] =
BidiFlow.fromGraph(new Http2ServerDemux(settings, initialDemuxerSettings, upgraded))

Expand Down
Loading