├── .asf.yaml ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── ---bug-report.md │ ├── ---feature-request.md │ └── ---question.md ├── actions │ └── sync-nightlies │ │ └── action.yml └── workflows │ ├── dependency-graph.yml │ ├── format.yml │ ├── headers.yml │ ├── link-validator.yml │ ├── nightly.yml │ ├── publish-1.0-docs.yml │ ├── publish-1.0-snapshots.yml │ ├── publish-1.1-docs.yml │ ├── publish-1.1-snapshots.yml │ ├── publish-1.2-docs.yml │ ├── publish-test-reports.yml │ ├── publish.yml │ ├── scala-steward.yml │ └── validate-and-test.yml ├── .gitignore ├── .jvmopts ├── .jvmopts-ci ├── .scala-steward.conf ├── .scalafmt.conf ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE ├── README.md ├── build.sbt ├── docs └── src │ ├── main │ └── paradox │ │ ├── .htaccess │ │ ├── DispatcherBehaviourOnBadCode.png │ │ ├── DispatcherBehaviourOnGoodCode.png │ │ ├── client-side │ │ ├── client-https-support.md │ │ ├── client-transport.md │ │ ├── configuration.md │ │ ├── connection-level.md │ │ ├── host-level.md │ │ ├── http2.md │ │ ├── index.md │ │ ├── pool-overflow.md │ │ ├── request-and-response.md │ │ ├── request-level.md │ │ └── websocket-support.md │ │ ├── common │ │ ├── caching.md │ │ ├── cors.md │ │ ├── encoding.md │ │ ├── http-model.md │ │ ├── index.md │ │ ├── json-support.md │ │ ├── marshalling.md │ │ ├── sse-support.md │ │ ├── timeouts.md │ │ ├── unmarshalling.md │ │ ├── uri-model.md │ │ └── xml-support.md │ │ ├── compatibility-guidelines.md │ │ ├── configuration.md │ │ ├── contributing.md │ │ ├── examples-and-extensions.md │ │ ├── handling-blocking-operations-in-pekko-http-routes.md │ │ ├── implications-of-streaming-http-entity.md │ │ ├── index.md │ │ ├── introduction.md │ │ ├── migration-guide │ │ └── index.md │ │ ├── org │ │ └── apache │ │ │ └── pekko-http-file-listing.png │ │ ├── reference.md │ │ ├── release-notes │ │ ├── index.md │ │ ├── releases-1.0.md │ │ ├── releases-1.1.md │ │ └── releases-1.2.md │ │ ├── routing-dsl │ │ ├── case-class-extraction.md │ │ ├── directives │ │ │ ├── alphabetically.md │ │ │ ├── attribute-directives │ │ │ │ ├── attribute.md │ │ │ │ ├── index.md │ │ │ │ └── optionalAttribute.md │ │ │ ├── basic-directives │ │ │ │ ├── cancelRejection.md │ │ │ │ ├── cancelRejections.md │ │ │ │ ├── extract.md │ │ │ │ ├── extractActorSystem.md │ │ │ │ ├── extractDataBytes.md │ │ │ │ ├── extractExecutionContext.md │ │ │ │ ├── extractLog.md │ │ │ │ ├── extractMatchedPath.md │ │ │ │ ├── extractMaterializer.md │ │ │ │ ├── extractParserSettings.md │ │ │ │ ├── extractRequest.md │ │ │ │ ├── extractRequestContext.md │ │ │ │ ├── extractRequestEntity.md │ │ │ │ ├── extractSettings.md │ │ │ │ ├── extractStrictEntity.md │ │ │ │ ├── extractUnmatchedPath.md │ │ │ │ ├── extractUri.md │ │ │ │ ├── index.md │ │ │ │ ├── mapInnerRoute.md │ │ │ │ ├── mapRejections.md │ │ │ │ ├── mapRequest.md │ │ │ │ ├── mapRequestContext.md │ │ │ │ ├── mapResponse.md │ │ │ │ ├── mapResponseEntity.md │ │ │ │ ├── mapResponseHeaders.md │ │ │ │ ├── mapRouteResult.md │ │ │ │ ├── mapRouteResultFuture.md │ │ │ │ ├── mapRouteResultPF.md │ │ │ │ ├── mapRouteResultWith.md │ │ │ │ ├── mapRouteResultWithPF.md │ │ │ │ ├── mapSettings.md │ │ │ │ ├── mapUnmatchedPath.md │ │ │ │ ├── pass.md │ │ │ │ ├── provide.md │ │ │ │ ├── recoverRejections.md │ │ │ │ ├── recoverRejectionsWith.md │ │ │ │ ├── textract.md │ │ │ │ ├── toStrictEntity.md │ │ │ │ ├── tprovide.md │ │ │ │ ├── withExecutionContext.md │ │ │ │ ├── withLog.md │ │ │ │ ├── withMaterializer.md │ │ │ │ └── withSettings.md │ │ │ ├── by-trait.md │ │ │ ├── cache-condition-directives │ │ │ │ ├── conditional.md │ │ │ │ └── index.md │ │ │ ├── caching-directives │ │ │ │ ├── alwaysCache.md │ │ │ │ ├── cache.md │ │ │ │ ├── cachingProhibited.md │ │ │ │ └── index.md │ │ │ ├── coding-directives │ │ │ │ ├── decodeRequest.md │ │ │ │ ├── decodeRequestWith.md │ │ │ │ ├── encodeResponse.md │ │ │ │ ├── encodeResponseWith.md │ │ │ │ ├── index.md │ │ │ │ ├── requestEncodedWith.md │ │ │ │ ├── responseEncodingAccepted.md │ │ │ │ └── withPrecompressedMediaTypeSupport.md │ │ │ ├── cookie-directives │ │ │ │ ├── cookie.md │ │ │ │ ├── deleteCookie.md │ │ │ │ ├── index.md │ │ │ │ ├── optionalCookie.md │ │ │ │ └── setCookie.md │ │ │ ├── custom-directives.md │ │ │ ├── debugging-directives │ │ │ │ ├── index.md │ │ │ │ ├── logRequest.md │ │ │ │ ├── logRequestResult.md │ │ │ │ └── logResult.md │ │ │ ├── execution-directives │ │ │ │ ├── handleExceptions.md │ │ │ │ ├── handleRejections.md │ │ │ │ └── index.md │ │ │ ├── file-and-resource-directives │ │ │ │ ├── getFromBrowseableDirectories.md │ │ │ │ ├── getFromBrowseableDirectory.md │ │ │ │ ├── getFromDirectory.md │ │ │ │ ├── getFromFile.md │ │ │ │ ├── getFromResource.md │ │ │ │ ├── getFromResourceDirectory.md │ │ │ │ ├── index.md │ │ │ │ └── listDirectoryContents.md │ │ │ ├── file-upload-directives │ │ │ │ ├── fileUpload.md │ │ │ │ ├── fileUploadAll.md │ │ │ │ ├── index.md │ │ │ │ ├── storeUploadedFile.md │ │ │ │ └── storeUploadedFiles.md │ │ │ ├── form-field-directives │ │ │ │ ├── formField.md │ │ │ │ ├── formFieldMap.md │ │ │ │ ├── formFieldMultiMap.md │ │ │ │ ├── formFieldSeq.md │ │ │ │ ├── formFields.md │ │ │ │ └── index.md │ │ │ ├── future-directives │ │ │ │ ├── completeOrRecoverWith.md │ │ │ │ ├── index.md │ │ │ │ ├── onComplete.md │ │ │ │ ├── onCompleteWithBreaker.md │ │ │ │ └── onSuccess.md │ │ │ ├── header-directives │ │ │ │ ├── checkSameOrigin.md │ │ │ │ ├── headerValue.md │ │ │ │ ├── headerValueByName.md │ │ │ │ ├── headerValueByType.md │ │ │ │ ├── headerValuePF.md │ │ │ │ ├── index.md │ │ │ │ ├── optionalHeaderValue.md │ │ │ │ ├── optionalHeaderValueByName.md │ │ │ │ ├── optionalHeaderValueByType.md │ │ │ │ └── optionalHeaderValuePF.md │ │ │ ├── host-directives │ │ │ │ ├── extractHost.md │ │ │ │ ├── host.md │ │ │ │ └── index.md │ │ │ ├── index.md │ │ │ ├── marshalling-directives │ │ │ │ ├── completeWith.md │ │ │ │ ├── entity.md │ │ │ │ ├── handleWith.md │ │ │ │ └── index.md │ │ │ ├── method-directives │ │ │ │ ├── delete.md │ │ │ │ ├── extractMethod.md │ │ │ │ ├── get.md │ │ │ │ ├── head.md │ │ │ │ ├── index.md │ │ │ │ ├── method.md │ │ │ │ ├── options.md │ │ │ │ ├── overrideMethodWithParameter.md │ │ │ │ ├── patch.md │ │ │ │ ├── post.md │ │ │ │ └── put.md │ │ │ ├── misc-directives │ │ │ │ ├── extractClientIP.md │ │ │ │ ├── index.md │ │ │ │ ├── rejectEmptyResponse.md │ │ │ │ ├── requestEntityEmpty.md │ │ │ │ ├── requestEntityPresent.md │ │ │ │ ├── selectPreferredLanguage.md │ │ │ │ ├── validate.md │ │ │ │ ├── withSizeLimit.md │ │ │ │ └── withoutSizeLimit.md │ │ │ ├── parameter-directives │ │ │ │ ├── index.md │ │ │ │ ├── parameter.md │ │ │ │ ├── parameterMap.md │ │ │ │ ├── parameterMultiMap.md │ │ │ │ ├── parameterSeq.md │ │ │ │ └── parameters.md │ │ │ ├── path-directives │ │ │ │ ├── ignoreTrailingSlash.md │ │ │ │ ├── index.md │ │ │ │ ├── path.md │ │ │ │ ├── pathEnd.md │ │ │ │ ├── pathEndOrSingleSlash.md │ │ │ │ ├── pathPrefix.md │ │ │ │ ├── pathPrefixTest.md │ │ │ │ ├── pathSingleSlash.md │ │ │ │ ├── pathSuffix.md │ │ │ │ ├── pathSuffixTest.md │ │ │ │ ├── rawPathPrefix.md │ │ │ │ ├── rawPathPrefixTest.md │ │ │ │ ├── redirectToNoTrailingSlashIfPresent.md │ │ │ │ └── redirectToTrailingSlashIfMissing.md │ │ │ ├── range-directives │ │ │ │ ├── index.md │ │ │ │ └── withRangeSupport.md │ │ │ ├── respond-with-directives │ │ │ │ ├── index.md │ │ │ │ ├── respondWithDefaultHeader.md │ │ │ │ ├── respondWithDefaultHeaders.md │ │ │ │ ├── respondWithHeader.md │ │ │ │ └── respondWithHeaders.md │ │ │ ├── route-directives │ │ │ │ ├── complete.md │ │ │ │ ├── failWith.md │ │ │ │ ├── handle.md │ │ │ │ ├── handleSync.md │ │ │ │ ├── index.md │ │ │ │ ├── redirect.md │ │ │ │ └── reject.md │ │ │ ├── scheme-directives │ │ │ │ ├── extractScheme.md │ │ │ │ ├── index.md │ │ │ │ └── scheme.md │ │ │ ├── security-directives │ │ │ │ ├── authenticateBasic.md │ │ │ │ ├── authenticateBasicAsync.md │ │ │ │ ├── authenticateBasicPF.md │ │ │ │ ├── authenticateBasicPFAsync.md │ │ │ │ ├── authenticateOAuth2.md │ │ │ │ ├── authenticateOAuth2Async.md │ │ │ │ ├── authenticateOAuth2PF.md │ │ │ │ ├── authenticateOAuth2PFAsync.md │ │ │ │ ├── authenticateOrRejectWithChallenge.md │ │ │ │ ├── authorize.md │ │ │ │ ├── authorizeAsync.md │ │ │ │ ├── extractCredentials.md │ │ │ │ └── index.md │ │ │ ├── timeout-directives │ │ │ │ ├── extractRequestTimeout.md │ │ │ │ ├── index.md │ │ │ │ ├── withRequestTimeout.md │ │ │ │ ├── withRequestTimeoutResponse.md │ │ │ │ └── withoutRequestTimeout.md │ │ │ └── websocket-directives │ │ │ │ ├── extractOfferedWsProtocols.md │ │ │ │ ├── extractUpgradeToWebSocket.md │ │ │ │ ├── extractWebSocketUpgrade.md │ │ │ │ ├── handleWebSocketMessages.md │ │ │ │ ├── handleWebSocketMessagesForOptionalProtocol.md │ │ │ │ ├── handleWebSocketMessagesForProtocol.md │ │ │ │ └── index.md │ │ ├── exception-handling.md │ │ ├── index.md │ │ ├── overview.md │ │ ├── path-matchers.md │ │ ├── play-comparison.md │ │ ├── rejections.md │ │ ├── routes.md │ │ ├── source-streaming-support.md │ │ ├── style-guide.md │ │ └── testkit.md │ │ ├── security.md │ │ ├── server-side │ │ ├── graceful-termination.md │ │ ├── http2.md │ │ ├── index.md │ │ ├── low-level-api.md │ │ ├── server-https-support.md │ │ └── websocket-support.md │ │ ├── technologies.md │ │ ├── tipsandtricks.md │ │ ├── troubleshooting │ │ ├── index.md │ │ └── unsupported-http-method-pri.md │ │ └── usage.md │ └── test │ ├── java │ └── docs │ │ └── http │ │ └── javadsl │ │ ├── ClientSingleRequestExample.java │ │ ├── ComposeDirectivesExampleTest.java │ │ ├── CustomHeaderExampleTest.java │ │ ├── CustomMediaTypesExampleTest.java │ │ ├── CustomStatusCodesExampleTest.java │ │ ├── ExceptionHandlerExample.java │ │ ├── ExceptionHandlerInSealExample.java │ │ ├── Http2ClientApp.java │ │ ├── Http2Test.java │ │ ├── HttpClientDecodingExampleTest.java │ │ ├── HttpClientExampleDocTest.java │ │ ├── HttpRequestDetailedStringExampleTest.java │ │ ├── HttpResponseDetailedStringExampleTest.java │ │ ├── HttpServerActorInteractionExample.java │ │ ├── HttpServerDynamicRoutingExampleTest.java │ │ ├── HttpServerLowLevelExample.java │ │ ├── HttpServerMinimalExampleTest.java │ │ ├── HttpServerStreamRandomNumbersTest.java │ │ ├── HttpServerWithActorsSample.java │ │ ├── HttpsExamplesDocTest.java │ │ ├── JacksonExampleTest.java │ │ ├── JacksonXmlExampleTest.java │ │ ├── JacksonXmlSupport.java │ │ ├── JobRepository.java │ │ ├── JobRoutes.java │ │ ├── ModelDocTest.java │ │ ├── RespondWithHeaderHandlerExampleTest.java │ │ ├── RouteSealExample.java │ │ ├── UnmarshalTest.java │ │ ├── WebSocketClientExampleTest.java │ │ └── server │ │ ├── BlockingInHttpExamples.java │ │ ├── DirectiveExamplesTest.java │ │ ├── FileUploadExamplesTest.java │ │ ├── FormFieldRequestValsExampleTest.java │ │ ├── HeaderRequestValsExampleTest.java │ │ ├── HighLevelServerBindFailureExample.java │ │ ├── HighLevelServerExample.java │ │ ├── HttpBasicAuthenticatorExample.java │ │ ├── HttpServerExampleDocTest.java │ │ ├── HttpsServerExampleTest.java │ │ ├── JsonStreamingExamplesTest.java │ │ ├── OAuth2AuthenticatorExample.java │ │ ├── PathDirectiveExampleTest.java │ │ ├── PekkoHttp1020MigrationExample.java │ │ ├── RejectionHandlerExamplesTest.java │ │ ├── ServerShutdownExampleTest.java │ │ ├── WebSocketCoreExample.java │ │ ├── WebSocketRoutingExample.java │ │ ├── cors │ │ └── CorsServerExample.java │ │ ├── directives │ │ ├── AttributeDirectivesExamplesTest.java │ │ ├── BasicDirectivesExamplesTest.java │ │ ├── CachingDirectivesExamplesTest.java │ │ ├── CodingDirectivesExamplesTest.java │ │ ├── CookieDirectivesExamplesTest.java │ │ ├── CustomDirectivesExamplesTest.java │ │ ├── CustomHttpMethodExamplesTest.java │ │ ├── DebuggingDirectivesExamplesTest.java │ │ ├── ExecutionDirectivesExamplesTest.java │ │ ├── FileAndResourceDirectivesExamplesTest.java │ │ ├── FileUploadDirectivesExamplesTest.java │ │ ├── FormFieldDirectivesExamplesTest.java │ │ ├── FutureDirectivesExamplesTest.java │ │ ├── HeaderDirectivesExamplesTest.java │ │ ├── HostDirectivesExamplesTest.java │ │ ├── JsonStreamingFullExample.java │ │ ├── MarshallingDirectivesExamplesTest.java │ │ ├── MethodDirectivesExamplesTest.java │ │ ├── MiscDirectivesExamplesTest.java │ │ ├── ParameterDirectivesExamplesTest.java │ │ ├── PathDirectivesExamplesTest.java │ │ ├── RangeDirectivesExamplesTest.java │ │ ├── RespondWithDirectivesExamplesTest.java │ │ ├── RouteDirectivesExamplesTest.java │ │ ├── SchemeDirectivesExamplesTest.java │ │ ├── SecurityDirectivesExamplesTest.java │ │ ├── StyleGuideExamplesTest.java │ │ ├── TimeoutDirectivesExamplesTest.java │ │ └── WebSocketDirectivesExamplesTest.java │ │ └── testkit │ │ ├── MyAppFragment.java │ │ ├── MyAppService.java │ │ ├── MyAppWithActor.java │ │ ├── PlayRoutesComparisonTest.java │ │ ├── TestKitFragmentTest.java │ │ ├── TestKitWithActorTest.java │ │ ├── TestkitExampleTest.java │ │ └── WithTimeoutTest.java │ ├── resources │ └── application.conf │ └── scala │ └── docs │ ├── ApiMayChangeDocCheckerSpec.scala │ ├── CompileOnlySpec.scala │ └── http │ └── scaladsl │ ├── Http2ClientApp.scala │ ├── Http2Spec.scala │ ├── HttpClientCollectingHeaders.scala │ ├── HttpClientDecodingExampleSpec.scala │ ├── HttpClientExampleSpec.scala │ ├── HttpClientOutgoingConnection.scala │ ├── HttpClientSingleRequest.scala │ ├── HttpRequestDetailedStringExampleSpec.scala │ ├── HttpResponseDetailedStringExampleSpec.scala │ ├── HttpServerBindingFailure.scala │ ├── HttpServerExampleSpec.scala │ ├── HttpServerHighLevel.scala │ ├── HttpServerLowLevel.scala │ ├── HttpServerRoutingMinimal.scala │ ├── HttpServerStreamingRandomNumbers.scala │ ├── HttpServerWithActorInteraction.scala │ ├── HttpServerWithActorsSample.scala │ ├── HttpsExamplesSpec.scala │ ├── MarshalSpec.scala │ ├── ModelSpec.scala │ ├── RouteSealExampleSpec.scala │ ├── ServerSentEventsExampleSpec.scala │ ├── SingleWebSocketRequest.scala │ ├── SprayJsonExample.scala │ ├── SprayJsonExampleSpec.scala │ ├── SprayJsonPrettyMarshalSpec.scala │ ├── UnmarshalSpec.scala │ ├── WebSocketClientExampleSpec.scala │ ├── WebSocketClientFlow.scala │ └── server │ ├── BlockingInHttpExamplesSpec.scala │ ├── CaseClassExtractionExamplesSpec.scala │ ├── DirectiveExamplesSpec.scala │ ├── ExceptionHandlerExamplesSpec.scala │ ├── FileUploadExamplesSpec.scala │ ├── FragmentExample.scala │ ├── FullSpecs2TestKitExampleSpec.scala │ ├── FullTestKitExampleSpec.scala │ ├── HttpsServerExampleSpec.scala │ ├── PekkoHttp1020MigrationSpec.scala │ ├── PlayRoutesComparisonSpec.scala │ ├── RejectionHandlerExamplesSpec.scala │ ├── ServerShutdownExampleSpec.scala │ ├── TestKitFragmentSpec.scala │ ├── TestKitWithActorSpec.scala │ ├── WebSocketExampleSpec.scala │ ├── cors │ └── CorsServerExample.scala │ └── directives │ ├── AttributeDirectivesExamplesSpec.scala │ ├── BasicDirectivesExamplesSpec.scala │ ├── CachingDirectivesExamplesSpec.scala │ ├── CodingDirectivesExamplesSpec.scala │ ├── CookieDirectivesExamplesSpec.scala │ ├── CustomDirectivesExamplesSpec.scala │ ├── CustomHttpMethodSpec.scala │ ├── DebuggingDirectivesExamplesSpec.scala │ ├── ExecutionDirectivesExamplesSpec.scala │ ├── FileAndResourceDirectivesExamplesSpec.scala │ ├── FileUploadDirectivesExamplesSpec.scala │ ├── FormFieldDirectivesExamplesSpec.scala │ ├── FutureDirectivesExamplesSpec.scala │ ├── HeaderDirectivesExamplesSpec.scala │ ├── HostDirectivesExamplesSpec.scala │ ├── JsonStreamingExamplesSpec.scala │ ├── JsonStreamingFullExamples.scala │ ├── MarshallingDirectivesExamplesSpec.scala │ ├── MethodDirectivesExamplesSpec.scala │ ├── MiscDirectivesExamplesSpec.scala │ ├── ParameterDirectivesExamplesSpec.scala │ ├── PathDirectivesExamplesSpec.scala │ ├── RangeDirectivesExamplesSpec.scala │ ├── RespondWithDirectivesExamplesSpec.scala │ ├── RouteDirectivesExamplesSpec.scala │ ├── SchemeDirectivesExamplesSpec.scala │ ├── SecurityDirectivesExamplesSpec.scala │ ├── StyleGuideExamplesSpec.scala │ ├── TimeoutDirectivesExamplesSpec.scala │ └── WebSocketDirectivesExamplesSpec.scala ├── http-bench-jmh ├── README.md └── src │ └── main │ └── scala │ └── org │ └── apache │ └── pekko │ ├── BenchRunner.scala │ ├── BenchTestSource.scala │ └── http │ ├── CommonBenchmark.scala │ ├── cors │ └── CorsBenchmark.scala │ ├── impl │ ├── engine │ │ ├── ConnectionPoolBenchmark.scala │ │ ├── HeaderParserBenchmark.scala │ │ ├── HttpEntityBenchmark.scala │ │ ├── MessageToFrameRendererBenchmark.scala │ │ ├── ServerProcessingBenchmark.scala │ │ ├── StreamServerProcessingBenchmark.scala │ │ ├── http2 │ │ │ ├── H2ClientServerBenchmark.scala │ │ │ ├── H2RequestResponseBenchmark.scala │ │ │ └── H2ServerProcessingBenchmark.scala │ │ └── ws │ │ │ └── MaskingBench.scala │ └── model │ │ └── parser │ │ └── UriParserBenchmark.scala │ └── scaladsl │ └── unmarshalling │ └── sse │ └── LineParserBenchmark.scala ├── http-caching └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── caching │ │ │ └── javadsl │ │ │ └── Cache.java │ ├── resources │ │ └── reference.conf │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ ├── caching │ │ ├── CacheJavaMapping.scala │ │ ├── LfuCache.scala │ │ ├── impl │ │ │ └── settings │ │ │ │ ├── CachingSettingsImpl.scala │ │ │ │ └── LfuCachingSettingsImpl.scala │ │ ├── javadsl │ │ │ ├── CachingSettings.scala │ │ │ └── LfuCacheSettings.scala │ │ └── scaladsl │ │ │ ├── Cache.scala │ │ │ ├── CachingSettings.scala │ │ │ └── LfuCacheSettings.scala │ │ ├── javadsl │ │ └── server │ │ │ └── directives │ │ │ └── CachingDirectives.scala │ │ └── scaladsl │ │ └── server │ │ └── directives │ │ └── CachingDirectives.scala │ └── test │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ ├── caching │ └── ExpiringLfuCacheSpec.scala │ └── scaladsl │ └── server │ └── directives │ └── CachingDirectivesSpec.scala ├── http-compatibility-tests ├── README.md └── src │ ├── main │ └── scala │ │ ├── example │ │ └── HostConnectionPoolCompat.scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── scaladsl │ │ └── server │ │ └── directives │ │ └── CompatFormField.scala │ └── test │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── scaladsl │ ├── HostConnectionPoolCompatSpec.scala │ └── server │ └── directives │ └── CompatFormFieldSpec.scala ├── http-core ├── RunWebSocketAutobahnTestSuite.md └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ ├── impl │ │ │ └── util │ │ │ │ └── Util.java │ │ │ ├── javadsl │ │ │ ├── TimeoutAccess.java │ │ │ └── model │ │ │ │ ├── AttributeKey.java │ │ │ │ ├── AttributeKeys.java │ │ │ │ ├── Authority.java │ │ │ │ ├── BodyPartEntity.java │ │ │ │ ├── ContentRange.java │ │ │ │ ├── ContentTypeRange.java │ │ │ │ ├── ContentTypes.java │ │ │ │ ├── DateTime.java │ │ │ │ ├── FormData.java │ │ │ │ ├── Host.java │ │ │ │ ├── HttpCharset.java │ │ │ │ ├── HttpCharsetRange.java │ │ │ │ ├── HttpCharsetRanges.java │ │ │ │ ├── HttpCharsets.java │ │ │ │ ├── HttpEntities.java │ │ │ │ ├── HttpEntity.java │ │ │ │ ├── HttpHeader.java │ │ │ │ ├── HttpMessage.java │ │ │ │ ├── HttpMethod.java │ │ │ │ ├── HttpMethods.java │ │ │ │ ├── HttpProtocol.java │ │ │ │ ├── HttpProtocols.java │ │ │ │ ├── HttpRequest.java │ │ │ │ ├── HttpResponse.java │ │ │ │ ├── MediaRange.java │ │ │ │ ├── MediaRanges.java │ │ │ │ ├── MediaTypes.java │ │ │ │ ├── Multipart.java │ │ │ │ ├── Multiparts.java │ │ │ │ ├── Query.java │ │ │ │ ├── RemoteAddress.java │ │ │ │ ├── RemoteAddresses.java │ │ │ │ ├── RequestEntity.java │ │ │ │ ├── RequestEntityAcceptance.java │ │ │ │ ├── RequestEntityAcceptances.java │ │ │ │ ├── ResponseEntity.java │ │ │ │ ├── StatusCode.java │ │ │ │ ├── StatusCodes.java │ │ │ │ ├── TransferEncoding.java │ │ │ │ ├── TransferEncodings.java │ │ │ │ ├── UniversalEntity.java │ │ │ │ ├── Uri.java │ │ │ │ ├── headers │ │ │ │ ├── Accept.java │ │ │ │ ├── AcceptCharset.java │ │ │ │ ├── AcceptEncoding.java │ │ │ │ ├── AcceptLanguage.java │ │ │ │ ├── AcceptRanges.java │ │ │ │ ├── AccessControlAllowCredentials.java │ │ │ │ ├── AccessControlAllowHeaders.java │ │ │ │ ├── AccessControlAllowMethods.java │ │ │ │ ├── AccessControlAllowOrigin.java │ │ │ │ ├── AccessControlExposeHeaders.java │ │ │ │ ├── AccessControlMaxAge.java │ │ │ │ ├── AccessControlRequestHeaders.java │ │ │ │ ├── AccessControlRequestMethod.java │ │ │ │ ├── Age.java │ │ │ │ ├── Allow.java │ │ │ │ ├── Authorization.java │ │ │ │ ├── BasicHttpCredentials.java │ │ │ │ ├── ByteRange.java │ │ │ │ ├── CacheControl.java │ │ │ │ ├── CacheDirective.java │ │ │ │ ├── CacheDirectives.java │ │ │ │ ├── Connection.java │ │ │ │ ├── ContentDisposition.java │ │ │ │ ├── ContentDispositionType.java │ │ │ │ ├── ContentDispositionTypes.java │ │ │ │ ├── ContentEncoding.java │ │ │ │ ├── ContentLength.java │ │ │ │ ├── ContentLocation.java │ │ │ │ ├── ContentRange.java │ │ │ │ ├── ContentType.java │ │ │ │ ├── Cookie.java │ │ │ │ ├── CustomHeader.java │ │ │ │ ├── Date.java │ │ │ │ ├── ETag.java │ │ │ │ ├── EntityTag.java │ │ │ │ ├── EntityTagRange.java │ │ │ │ ├── EntityTagRanges.java │ │ │ │ ├── Expires.java │ │ │ │ ├── Host.java │ │ │ │ ├── HttpChallenge.java │ │ │ │ ├── HttpCookie.java │ │ │ │ ├── HttpCookiePair.java │ │ │ │ ├── HttpCredentials.java │ │ │ │ ├── HttpEncoding.java │ │ │ │ ├── HttpEncodingRange.java │ │ │ │ ├── HttpEncodingRanges.java │ │ │ │ ├── HttpEncodings.java │ │ │ │ ├── HttpOrigin.java │ │ │ │ ├── HttpOriginRange.java │ │ │ │ ├── HttpOriginRanges.java │ │ │ │ ├── IfMatch.java │ │ │ │ ├── IfModifiedSince.java │ │ │ │ ├── IfNoneMatch.java │ │ │ │ ├── IfUnmodifiedSince.java │ │ │ │ ├── Language.java │ │ │ │ ├── LanguageRange.java │ │ │ │ ├── LanguageRanges.java │ │ │ │ ├── LastEventId.java │ │ │ │ ├── LastModified.java │ │ │ │ ├── Link.java │ │ │ │ ├── LinkParam.java │ │ │ │ ├── LinkParams.java │ │ │ │ ├── LinkValue.java │ │ │ │ ├── Location.java │ │ │ │ ├── ModeledCustomHeader.java │ │ │ │ ├── ModeledCustomHeaderFactory.java │ │ │ │ ├── OAuth2BearerToken.java │ │ │ │ ├── Origin.java │ │ │ │ ├── ProductVersion.java │ │ │ │ ├── ProxyAuthenticate.java │ │ │ │ ├── ProxyAuthorization.java │ │ │ │ ├── Range.java │ │ │ │ ├── RangeUnit.java │ │ │ │ ├── RangeUnits.java │ │ │ │ ├── RawHeader.java │ │ │ │ ├── RawRequestURI.java │ │ │ │ ├── Referer.java │ │ │ │ ├── RemoteAddress.java │ │ │ │ ├── RetryAfter.java │ │ │ │ ├── SameSite.java │ │ │ │ ├── SecWebSocketProtocol.java │ │ │ │ ├── Server.java │ │ │ │ ├── SetCookie.java │ │ │ │ ├── StrictTransportSecurity.java │ │ │ │ ├── TE.java │ │ │ │ ├── TimeoutAccess.java │ │ │ │ ├── TlsSessionInfo.java │ │ │ │ ├── TransferEncoding.java │ │ │ │ ├── UserAgent.java │ │ │ │ ├── WWWAuthenticate.java │ │ │ │ ├── XForwardedFor.java │ │ │ │ ├── XForwardedHost.java │ │ │ │ ├── XForwardedProto.java │ │ │ │ └── XRealIp.java │ │ │ │ └── sse │ │ │ │ └── ServerSentEvent.java │ │ │ └── shaded │ │ │ └── com │ │ │ └── twitter │ │ │ └── hpack │ │ │ ├── Decoder.java │ │ │ ├── DynamicTable.java │ │ │ ├── Encoder.java │ │ │ ├── HeaderField.java │ │ │ ├── HeaderListener.java │ │ │ ├── HpackUtil.java │ │ │ ├── Huffman.java │ │ │ ├── HuffmanDecoder.java │ │ │ ├── HuffmanEncoder.java │ │ │ ├── StaticTable.java │ │ │ └── package-info.java │ ├── mima-filters │ │ ├── 1.0.x.backwards.excludes │ │ │ └── http2-rapid-reset-configs.backwards.excludes │ │ └── 1.2.x.backwards.excludes │ │ │ ├── add-future-await-result-anyval.excludes │ │ │ └── content-media-type-value-string.backwards.excludes │ ├── resources │ │ └── reference.conf │ ├── scala-2.13+ │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ ├── ccompat │ │ │ ├── MapHelpers.scala │ │ │ ├── imm │ │ │ │ └── package.scala │ │ │ └── package.scala │ │ │ └── scaladsl │ │ │ └── util │ │ │ └── FastFuture.scala │ ├── scala-2.13- │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ ├── ccompat │ │ │ ├── CompatImpl.scala │ │ │ ├── MapHelpers.scala │ │ │ ├── imm │ │ │ │ └── package.scala │ │ │ └── package.scala │ │ │ └── scaladsl │ │ │ └── util │ │ │ └── FastFuture.scala │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ ├── ParsingErrorHandler.scala │ │ ├── impl │ │ ├── engine │ │ │ ├── HttpConnectionIdleTimeoutBidi.scala │ │ │ ├── client │ │ │ │ ├── HttpsProxyGraphStage.scala │ │ │ │ ├── OutgoingConnectionBlueprint.scala │ │ │ │ ├── PoolFlow.scala │ │ │ │ ├── PoolId.scala │ │ │ │ ├── PoolInterface.scala │ │ │ │ ├── PoolMasterActor.scala │ │ │ │ └── pool │ │ │ │ │ ├── NewHostConnectionPool.scala │ │ │ │ │ └── SlotState.scala │ │ │ ├── http2 │ │ │ │ ├── BufferedOutletSupport.scala │ │ │ │ ├── ByteFlag.scala │ │ │ │ ├── FrameEvent.scala │ │ │ │ ├── FrameLogger.scala │ │ │ │ ├── Http2.scala │ │ │ │ ├── Http2AlpnSupport.scala │ │ │ │ ├── Http2Blueprint.scala │ │ │ │ ├── Http2Compliance.scala │ │ │ │ ├── Http2Demux.scala │ │ │ │ ├── Http2Multiplexer.scala │ │ │ │ ├── Http2Protocol.scala │ │ │ │ ├── Http2SettingsHeader.scala │ │ │ │ ├── Http2StreamHandling.scala │ │ │ │ ├── HttpMessageRendering.scala │ │ │ │ ├── IncomingFlowController.scala │ │ │ │ ├── OutgoingConnectionBuilderImpl.scala │ │ │ │ ├── PriorityTree.scala │ │ │ │ ├── ProtocolSwitch.scala │ │ │ │ ├── RequestParsing.scala │ │ │ │ ├── StreamPrioritizer.scala │ │ │ │ ├── TelemetrySpi.scala │ │ │ │ ├── client │ │ │ │ │ ├── PersistentConnection.scala │ │ │ │ │ └── ResponseParsing.scala │ │ │ │ ├── framing │ │ │ │ │ ├── FrameRenderer.scala │ │ │ │ │ └── Http2FrameParsing.scala │ │ │ │ ├── hpack │ │ │ │ │ ├── ByteStringInputStream.scala │ │ │ │ │ ├── HandleOrPassOnStage.scala │ │ │ │ │ ├── HeaderCompression.scala │ │ │ │ │ ├── HeaderDecompression.scala │ │ │ │ │ └── Http2HeaderParsing.scala │ │ │ │ └── util │ │ │ │ │ └── AsciiTreeLayout.scala │ │ │ ├── parsing │ │ │ │ ├── BodyPartParser.scala │ │ │ │ ├── BoyerMoore.scala │ │ │ │ ├── HttpHeaderParser.scala │ │ │ │ ├── HttpMessageParser.scala │ │ │ │ ├── HttpRequestParser.scala │ │ │ │ ├── HttpResponseParser.scala │ │ │ │ ├── ParserOutput.scala │ │ │ │ ├── SpecializedHeaderValueParsers.scala │ │ │ │ └── package.scala │ │ │ ├── rendering │ │ │ │ ├── BodyPartRenderer.scala │ │ │ │ ├── DateHeaderRendering.scala │ │ │ │ ├── HttpRequestRendererFactory.scala │ │ │ │ ├── HttpResponseRendererFactory.scala │ │ │ │ └── RenderSupport.scala │ │ │ ├── server │ │ │ │ ├── HttpAttributes.scala │ │ │ │ ├── HttpServerBluePrint.scala │ │ │ │ ├── ServerTerminator.scala │ │ │ │ └── UpgradeToOtherProtocolResponseHeader.scala │ │ │ └── ws │ │ │ │ ├── FrameEvent.scala │ │ │ │ ├── FrameEventParser.scala │ │ │ │ ├── FrameEventRenderer.scala │ │ │ │ ├── FrameHandler.scala │ │ │ │ ├── FrameLogger.scala │ │ │ │ ├── FrameOutHandler.scala │ │ │ │ ├── Handshake.scala │ │ │ │ ├── Masking.scala │ │ │ │ ├── MessageToFrameRenderer.scala │ │ │ │ ├── Protocol.scala │ │ │ │ ├── Randoms.scala │ │ │ │ ├── UpgradeToWebSocketLowLevel.scala │ │ │ │ ├── Utf8Decoder.scala │ │ │ │ ├── Utf8Encoder.scala │ │ │ │ ├── WebSocket.scala │ │ │ │ └── WebSocketClientBlueprint.scala │ │ ├── model │ │ │ ├── JavaQuery.scala │ │ │ ├── JavaUri.scala │ │ │ ├── UriJavaAccessor.scala │ │ │ └── parser │ │ │ │ ├── AcceptCharsetHeader.scala │ │ │ │ ├── AcceptEncodingHeader.scala │ │ │ │ ├── AcceptHeader.scala │ │ │ │ ├── AcceptLanguageHeader.scala │ │ │ │ ├── CacheControlHeader.scala │ │ │ │ ├── CharacterClasses.scala │ │ │ │ ├── CommonActions.scala │ │ │ │ ├── CommonRules.scala │ │ │ │ ├── ContentDispositionHeader.scala │ │ │ │ ├── ContentTypeHeader.scala │ │ │ │ ├── HeaderParser.scala │ │ │ │ ├── IpAddressParsing.scala │ │ │ │ ├── LinkHeader.scala │ │ │ │ ├── SimpleHeaders.scala │ │ │ │ ├── UriParser.scala │ │ │ │ └── WebSocketHeaders.scala │ │ ├── settings │ │ │ ├── ClientConnectionSettingsImpl.scala │ │ │ ├── ConnectionPoolSettingsImpl.scala │ │ │ ├── ConnectionPoolSetup.scala │ │ │ ├── HostConnectionPoolSetup.scala │ │ │ ├── HttpsProxySettingsImpl.scala │ │ │ ├── ParserSettingsImpl.scala │ │ │ ├── PreviewServerSettingsImpl.scala │ │ │ ├── ServerSettingsImpl.scala │ │ │ └── WebSocketSettingsImpl.scala │ │ └── util │ │ │ ├── ByteStringParserInput.scala │ │ │ ├── EnhancedByteArray.scala │ │ │ ├── EnhancedByteStringTraversableOnce.scala │ │ │ ├── EnhancedConfig.scala │ │ │ ├── EnhancedRegex.scala │ │ │ ├── EnhancedString.scala │ │ │ ├── JavaAccessors.scala │ │ │ ├── JavaMapping.scala │ │ │ ├── JavaVersion.scala │ │ │ ├── LogByteStringTools.scala │ │ │ ├── ObjectRegistry.scala │ │ │ ├── One2OneBidiFlow.scala │ │ │ ├── Rendering.scala │ │ │ ├── SettingsCompanionImpl.scala │ │ │ ├── SingletonException.scala │ │ │ ├── SocketOptionSettings.scala │ │ │ ├── StageLoggingWithOverride.scala │ │ │ ├── StreamUtils.scala │ │ │ ├── StringTools.scala │ │ │ ├── Timestamp.scala │ │ │ └── package.scala │ │ ├── javadsl │ │ ├── ClientTransport.scala │ │ ├── ConnectHttp.scala │ │ ├── ConnectionContext.scala │ │ ├── HostConnectionPool.scala │ │ ├── Http.scala │ │ ├── IncomingConnection.scala │ │ ├── OutgoingConnection.scala │ │ ├── OutgoingConnectionBuilder.scala │ │ ├── ServerBinding.scala │ │ ├── ServerBuilder.scala │ │ ├── model │ │ │ ├── ContentType.scala │ │ │ ├── MediaType.scala │ │ │ ├── RequestResponseAssociation.scala │ │ │ ├── SslSessionInfo.scala │ │ │ ├── Trailer.scala │ │ │ └── ws │ │ │ │ ├── Message.scala │ │ │ │ ├── PeerClosedConnectionException.scala │ │ │ │ ├── UpgradeToWebSocket.scala │ │ │ │ ├── WebSocket.scala │ │ │ │ ├── WebSocketRequest.scala │ │ │ │ ├── WebSocketUpgrade.scala │ │ │ │ └── WebSocketUpgradeResponse.scala │ │ └── settings │ │ │ ├── ClientConnectionSettings.scala │ │ │ ├── ConnectionPoolSettings.scala │ │ │ ├── Http2ClientSettings.scala │ │ │ ├── Http2ServerSettings.scala │ │ │ ├── HttpsProxySettings.scala │ │ │ ├── ParserSettings.scala │ │ │ ├── PreviewServerSettings.scala │ │ │ ├── ServerSettings.scala │ │ │ ├── SettingsCompanion.scala │ │ │ └── WebSocketSettings.scala │ │ └── scaladsl │ │ ├── ClientTransport.scala │ │ ├── ConnectionContext.scala │ │ ├── Http.scala │ │ ├── OutgoingConnectionBuilder.scala │ │ ├── ServerBuilder.scala │ │ ├── TimeoutAccess.scala │ │ ├── model │ │ ├── AttributeKey.scala │ │ ├── AttributeKeys.scala │ │ ├── ContentRange.scala │ │ ├── ContentType.scala │ │ ├── DateTime.scala │ │ ├── ErrorInfo.scala │ │ ├── FormData.scala │ │ ├── HttpCharset.scala │ │ ├── HttpEntity.scala │ │ ├── HttpHeader.scala │ │ ├── HttpMessage.scala │ │ ├── HttpMethod.scala │ │ ├── HttpProtocol.scala │ │ ├── MediaRange.scala │ │ ├── MediaType.scala │ │ ├── Multipart.scala │ │ ├── RemoteAddress.scala │ │ ├── RequestResponseAssociation.scala │ │ ├── SslSessionInfo.scala │ │ ├── StatusCode.scala │ │ ├── Trailer.scala │ │ ├── TransferEncoding.scala │ │ ├── Uri.scala │ │ ├── WithQValue.scala │ │ ├── headers │ │ │ ├── ByteRange.scala │ │ │ ├── CacheDirective.scala │ │ │ ├── ContentDispositionType.scala │ │ │ ├── EntityTag.scala │ │ │ ├── HttpChallenge.scala │ │ │ ├── HttpCookie.scala │ │ │ ├── HttpCredentials.scala │ │ │ ├── HttpEncoding.scala │ │ │ ├── HttpOrigin.scala │ │ │ ├── LanguageRange.scala │ │ │ ├── LinkValue.scala │ │ │ ├── ProductVersion.scala │ │ │ ├── RangeUnit.scala │ │ │ ├── RetryAfterParameter.scala │ │ │ ├── StrictTransportSecurityDirective.scala │ │ │ ├── UpgradeProtocol.scala │ │ │ ├── WebSocketExtension.scala │ │ │ └── headers.scala │ │ ├── http2 │ │ │ └── Http2Exception.scala │ │ ├── package.scala │ │ ├── sse │ │ │ └── ServerSentEvent.scala │ │ └── ws │ │ │ ├── Message.scala │ │ │ ├── PeerClosedConnectionException.scala │ │ │ ├── UpgradeToWebSocket.scala │ │ │ ├── WebSocketRequest.scala │ │ │ ├── WebSocketUpgrade.scala │ │ │ └── WebSocketUpgradeResponse.scala │ │ └── settings │ │ ├── ClientConnectionSettings.scala │ │ ├── ConnectionPoolSettings.scala │ │ ├── Http2ServerSettings.scala │ │ ├── HttpsProxySettings.scala │ │ ├── ParserSettings.scala │ │ ├── PreviewServerSettings.scala │ │ ├── ServerSettings.scala │ │ ├── SettingsCompanion.scala │ │ └── WebSocketSettings.scala │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ ├── JavaTestServer.java │ │ └── javadsl │ │ ├── GracefulTerminationCompileTest.java │ │ ├── WSEchoTestClientApp.java │ │ ├── model │ │ ├── EntityDiscardingTest.java │ │ ├── HttpMessageTest.java │ │ ├── JavaApiTestCases.java │ │ ├── UriTest.java │ │ └── sse │ │ │ └── ServerSentEventTest.java │ │ └── settings │ │ ├── ClientConnectionSettingsTest.java │ │ ├── ConnectionPoolSettingsTest.java │ │ ├── ParserSettingsTest.java │ │ └── ServerSettingsTest.java │ ├── resources │ ├── keys │ │ ├── README.md │ │ ├── chain.pem │ │ ├── rootCA.crt │ │ ├── rootCA.key │ │ ├── server.crt │ │ ├── server.key │ │ └── server.p12 │ └── reference.conf │ └── scala │ ├── io │ └── pekko │ │ └── integrationtest │ │ └── http │ │ └── HttpModelIntegrationSpec.scala │ └── org │ └── apache │ └── pekko │ ├── http │ ├── ConfigSpec.scala │ ├── HashCodeCollider.scala │ ├── impl │ │ ├── engine │ │ │ ├── client │ │ │ │ ├── ClientCancellationSpec.scala │ │ │ │ ├── HighLevelOutgoingConnectionSpec.scala │ │ │ │ ├── HostConnectionPoolSpec.scala │ │ │ │ ├── HttpConfigurationSpec.scala │ │ │ │ ├── HttpsProxyGraphStageSpec.scala │ │ │ │ ├── LowLevelOutgoingConnectionSpec.scala │ │ │ │ ├── NewConnectionPoolSpec.scala │ │ │ │ ├── PrepareResponseSpec.scala │ │ │ │ ├── ResponseParsingMergeSpec.scala │ │ │ │ ├── TlsEndpointVerificationSpec.scala │ │ │ │ └── pool │ │ │ │ │ └── SlotStateSpec.scala │ │ │ ├── http2 │ │ │ │ └── Http2BlueprintSpec.scala │ │ │ ├── parsing │ │ │ │ ├── BoyerMooreSpec.scala │ │ │ │ ├── ContentLengthHeaderParserSpec.scala │ │ │ │ ├── HttpHeaderParserSpec.scala │ │ │ │ ├── HttpHeaderParserTestBed.scala │ │ │ │ ├── RequestParserSpec.scala │ │ │ │ └── ResponseParserSpec.scala │ │ │ ├── rendering │ │ │ │ ├── RequestRendererSpec.scala │ │ │ │ └── ResponseRendererSpec.scala │ │ │ ├── server │ │ │ │ ├── HttpServerBug21008Spec.scala │ │ │ │ ├── HttpServerSpec.scala │ │ │ │ ├── HttpServerTestSetupBase.scala │ │ │ │ ├── HttpServerWithExplicitSchedulerSpec.scala │ │ │ │ └── PrepareRequestsSpec.scala │ │ │ └── ws │ │ │ │ ├── BitBuilder.scala │ │ │ │ ├── ByteStringSinkProbe.scala │ │ │ │ ├── EchoTestClientApp.scala │ │ │ │ ├── FramingSpec.scala │ │ │ │ ├── MessageSpec.scala │ │ │ │ ├── Utf8CodingSpecs.scala │ │ │ │ ├── WSClientAutobahnTest.scala │ │ │ │ ├── WSServerAutobahnTest.scala │ │ │ │ ├── WSTestSetupBase.scala │ │ │ │ ├── WSTestUtils.scala │ │ │ │ ├── WebSocketClientSpec.scala │ │ │ │ ├── WebSocketIntegrationSpec.scala │ │ │ │ └── WebSocketServerSpec.scala │ │ ├── model │ │ │ └── parser │ │ │ │ └── HttpHeaderSpec.scala │ │ └── util │ │ │ ├── BenchUtils.scala │ │ │ ├── ByteStringParserInputSpec.scala │ │ │ ├── CollectionStage.scala │ │ │ ├── ExampleHttpContexts.scala │ │ │ ├── One2OneBidiFlowSpec.scala │ │ │ ├── PekkoSpecWithMaterializer.scala │ │ │ ├── RenderingSpec.scala │ │ │ ├── StreamUtilsSpec.scala │ │ │ └── WithLogCapturing.scala │ ├── javadsl │ │ ├── ConnectHttpSpec.scala │ │ ├── ConnectionContextSpec.scala │ │ ├── HttpExtensionApiSpec.scala │ │ ├── JavaInitializationSpec.scala │ │ └── model │ │ │ ├── JavaApiSpec.scala │ │ │ ├── JavaApiTestCaseSpecs.scala │ │ │ ├── MultipartsSpec.scala │ │ │ └── headers │ │ │ └── HttpCookieSpec.scala │ └── scaladsl │ │ ├── ClientServerSpec.scala │ │ ├── ClientSpec.scala │ │ ├── ClientTransportWithCustomResolverSpec.scala │ │ ├── GracefulTerminationSpec.scala │ │ ├── TestClient.scala │ │ ├── TestServer.scala │ │ ├── TightRequestTimeoutSpec.scala │ │ ├── model │ │ ├── DateTimeSpec.scala │ │ ├── EntityDiscardingSpec.scala │ │ ├── HttpEntitySpec.scala │ │ ├── HttpMessageSpec.scala │ │ ├── HttpMethodsSpec.scala │ │ ├── MultipartSpec.scala │ │ ├── SerializabilitySpec.scala │ │ ├── TurkishISpec.scala │ │ ├── UriSpec.scala │ │ ├── headers │ │ │ └── HeaderSpec.scala │ │ └── sse │ │ │ └── ServerSentEventSpec.scala │ │ ├── settings │ │ ├── ClientConnectionSettingsSpec.scala │ │ ├── ConnectionPoolSettingsSpec.scala │ │ ├── Http2CommonSettingsSpec.scala │ │ ├── PreviewServerSettingsSpec.scala │ │ ├── ServerSettingsSpec.scala │ │ └── SettingsEqualitySpec.scala │ │ └── util │ │ └── FastFutureSpec.scala │ ├── stream │ └── testkit │ │ └── Utils.scala │ └── testkit │ ├── Coroner.scala │ └── PekkoSpec.scala ├── http-cors └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── cors │ │ │ └── javadsl │ │ │ └── model │ │ │ ├── HttpHeaderRange.java │ │ │ ├── HttpHeaderRanges.java │ │ │ └── HttpOriginMatcher.java │ ├── resources │ │ └── reference.conf │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── cors │ │ ├── CorsJavaMapping.scala │ │ ├── javadsl │ │ ├── CorsDirectives.scala │ │ ├── CorsRejection.scala │ │ └── settings │ │ │ └── CorsSettings.scala │ │ └── scaladsl │ │ ├── CorsDirectives.scala │ │ ├── CorsRejection.scala │ │ ├── model │ │ ├── HttpHeaderRange.scala │ │ └── HttpOriginMatcher.scala │ │ └── settings │ │ ├── CorsSettings.scala │ │ └── CorsSettingsImpl.scala │ └── test │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── cors │ ├── CorsDirectivesSpec.scala │ └── scaladsl │ ├── model │ └── HttpOriginMatcherSpec.scala │ └── settings │ └── CorsSettingsSpec.scala ├── http-marshallers-java └── http-jackson │ └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── javadsl │ │ │ └── marshallers │ │ │ └── jackson │ │ │ └── Jackson.java │ └── resources │ │ └── reference.conf │ └── test │ └── java │ └── org │ └── apache │ └── pekko │ └── http │ └── javadsl │ └── marshallers │ └── jackson │ └── JacksonTest.java ├── http-marshallers-scala ├── http-spray-json │ └── src │ │ ├── main │ │ └── scala │ │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── scaladsl │ │ │ └── marshallers │ │ │ └── sprayjson │ │ │ ├── SprayJsonByteStringParserInput.scala │ │ │ └── SprayJsonSupport.scala │ │ └── test │ │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── scaladsl │ │ └── marshallers │ │ └── sprayjson │ │ └── SprayJsonSupportSpec.scala └── http-xml │ └── src │ └── main │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── scaladsl │ └── marshallers │ └── xml │ └── ScalaXmlSupport.scala ├── http-scalafix ├── README.md ├── scalafix-rules │ └── src │ │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── scalafix.v1.Rule │ │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── fix │ │ └── MigrateToServerBuilder.scala ├── scalafix-test-input │ └── src │ │ └── main │ │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── fix │ │ └── MigrateToServerBuilderTest.scala ├── scalafix-test-output │ └── src │ │ └── main │ │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── fix │ │ └── MigrateToServerBuilderTest.scala └── scalafix-tests │ └── src │ └── test │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── fix │ └── RuleSuite.scala ├── http-testkit-munit └── src │ ├── main │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── scaladsl │ │ └── testkit │ │ └── munit │ │ ├── MunitRouteTest.scala │ │ └── MunitTestFramework.scala │ └── test │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── scaladsl │ └── testkit │ └── munit │ └── MunitRouteTestSpec.scala ├── http-testkit └── src │ ├── main │ ├── resources │ │ └── reference.conf │ └── scala │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ ├── javadsl │ │ └── testkit │ │ │ ├── DefaultHostInfo.scala │ │ │ ├── JUnitRouteTest.scala │ │ │ ├── RouteTest.scala │ │ │ ├── TestRoute.scala │ │ │ ├── TestRouteResult.scala │ │ │ ├── WSProbe.scala │ │ │ └── WSTestRequestBuilding.scala │ │ └── scaladsl │ │ └── testkit │ │ ├── MarshallingTestUtils.scala │ │ ├── RouteTest.scala │ │ ├── RouteTestResultComponent.scala │ │ ├── RouteTestTimeout.scala │ │ ├── ScalatestUtils.scala │ │ ├── Specs2Utils.scala │ │ ├── TestFrameworkInterface.scala │ │ ├── WSProbe.scala │ │ └── WSTestRequestBuilding.scala │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── javadsl │ │ └── testkit │ │ └── JUnitRouteTestTest.java │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ └── scaladsl │ └── testkit │ ├── ScalatestRouteTestSpec.scala │ └── Specs2RouteTestSpec.scala ├── http-tests └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── javadsl │ │ │ └── server │ │ │ └── examples │ │ │ ├── petstore │ │ │ ├── Pet.java │ │ │ ├── PetStoreController.java │ │ │ └── PetStoreExample.java │ │ │ └── simple │ │ │ ├── SimpleServerApp.java │ │ │ └── SimpleServerHttpHttpsApp.java │ └── resources │ │ ├── httpsDemoKeys │ │ └── keys │ │ │ ├── README.md │ │ │ ├── chain.pem │ │ │ ├── rootCA.crt │ │ │ ├── rootCA.key │ │ │ ├── server.crt │ │ │ ├── server.key │ │ │ └── server.p12 │ │ └── web │ │ └── calculator.html │ ├── multi-jvm │ └── scala │ │ └── org │ │ ├── apache │ │ └── pekko │ │ │ ├── http │ │ │ ├── PekkoHttpServerLatencyMultiNodeSpec.scala │ │ │ └── STMultiNodeSpec.scala │ │ │ ├── remote │ │ │ └── testkit │ │ │ │ ├── MultiNodeConfig.scala │ │ │ │ └── PerfFlamesSupport.scala │ │ │ └── testkit │ │ │ └── TestTags.scala │ │ └── scalatest │ │ └── extra │ │ └── QuietReporter.scala │ └── test │ ├── extra-libs.zip │ ├── extra-libs.zip.README │ ├── java │ ├── AllJavaTests.java │ ├── docs │ │ └── http │ │ │ └── javadsl │ │ │ └── server │ │ │ ├── HandlerExampleDocTest.java │ │ │ └── RouteJavaScalaDslConversionTest.java │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── javadsl │ │ ├── HttpAPIsTest.java │ │ ├── marshalling │ │ └── sse │ │ │ └── EventStreamMarshallingTest.java │ │ ├── server │ │ ├── CompleteTest.java │ │ ├── HandlerBindingTest.java │ │ ├── JavaRouteTest.java │ │ ├── JavaTestServer.java │ │ ├── MarshallerTest.java │ │ ├── MinimalHttpApp.java │ │ ├── SneakHttpApp.java │ │ ├── UnmarshallerTest.java │ │ ├── directives │ │ │ ├── AttributeDirectivesTest.java │ │ │ ├── CodingDirectivesTest.java │ │ │ ├── ComposingDirectivesTest.java │ │ │ ├── CookieDirectivesTest.java │ │ │ ├── ExecutionDirectivesTest.java │ │ │ ├── HeaderDirectivesTest.java │ │ │ ├── HostDirectivesTest.java │ │ │ ├── MarshallingDirectivesTest.java │ │ │ ├── MiscDirectivesTest.java │ │ │ ├── ParameterDirectivesTest.java │ │ │ ├── PathDirectivesTest.java │ │ │ ├── RouteDirectivesTest.java │ │ │ ├── SchemeDirectivesTest.java │ │ │ └── SecurityDirectivesTest.java │ │ ├── examples │ │ │ ├── petstore │ │ │ │ └── PetStoreAPITest.java │ │ │ └── simple │ │ │ │ └── SimpleServerTest.java │ │ └── values │ │ │ ├── FormFieldsTest.java │ │ │ └── HeadersTest.java │ │ ├── settings │ │ └── RoutingSettingsTest.java │ │ └── unmarshalling │ │ └── sse │ │ └── EventStreamUnmarshallingTest.java │ ├── resources │ ├── application.conf │ ├── sample.html │ ├── sample.xyz │ ├── someDir │ │ ├── fileA.txt │ │ ├── fileB.xml │ │ └── sub │ │ │ └── file.html │ ├── subDirectory │ │ ├── empty.pdf │ │ └── fileA.txt │ └── sübdir │ │ └── sample späce.PDF │ ├── scala-2.13+ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── scaladsl │ │ └── server │ │ └── util │ │ └── VarArgsFunction1.scala │ ├── scala-2.13- │ ├── main │ │ └── org │ │ │ └── apache │ │ │ └── pekko │ │ │ └── http │ │ │ └── scaladsl │ │ │ └── server │ │ │ └── util │ │ │ └── package.scala │ └── src │ │ └── main │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── ccompat │ │ └── ImplicitUtils.scala │ ├── scala-2.13 │ └── src │ │ └── main │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── ccompat │ │ └── ImplicitUtils.scala │ ├── scala-3 │ └── src │ │ └── main │ │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── ccompat │ │ └── ImplicitUtils.scala │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ ├── HashCodeCollider.scala │ ├── javadsl │ ├── DirectivesConsistencySpec.scala │ └── server │ │ ├── HttpAppSpec.scala │ │ └── directives │ │ └── SampleCustomHeader.scala │ └── scaladsl │ ├── CustomMediaTypesSpec.scala │ ├── CustomStatusCodesSpec.scala │ ├── FormDataSpec.scala │ ├── RouteJavaScalaDslConversionSpec.scala │ ├── TestSingleRequest.scala │ ├── coding │ ├── CodecSpecSupport.scala │ ├── CoderSpec.scala │ ├── DecoderSpec.scala │ ├── DeflateSpec.scala │ ├── EncoderSpec.scala │ ├── GzipSpec.scala │ └── NoCodingSpec.scala │ ├── marshallers │ ├── JsonSupportSpec.scala │ ├── sprayjson │ │ └── SprayJsonSupportSpec.scala │ └── xml │ │ └── ScalaXmlSupportSpec.scala │ ├── marshalling │ ├── ContentNegotiationSpec.scala │ ├── FromStatusCodeAndXYZMarshallerSpec.scala │ ├── MarshallingSpec.scala │ └── sse │ │ └── EventStreamMarshallingSpec.scala │ ├── server │ ├── BasicRouteSpecs.scala │ ├── ConnectionTestApp.scala │ ├── DiscardEntityDefaultExceptionHandlerSpec.scala │ ├── DiscardEntityDefaultRejectionHandlerSpec.scala │ ├── DontLeakActorsOnFailingConnectionSpecs.scala │ ├── EntityStreamingSpec.scala │ ├── HttpAppSpec.scala │ ├── ModeledCustomHeaderSpec.scala │ ├── RejectionSpec.scala │ ├── RouteResultSpec.scala │ ├── RoutingSpec.scala │ ├── SizeLimitSpec.scala │ ├── StreamingResponseSpecs.scala │ ├── TcpLeakApp.scala │ ├── TestServer.scala │ ├── directives │ │ ├── AllowMaterializationOnlyOnce.scala │ │ ├── AttributeDirectivesSpec.scala │ │ ├── BasicDirectivesSpec.scala │ │ ├── CacheConditionDirectivesSpec.scala │ │ ├── CodingDirectivesSpec.scala │ │ ├── CookieDirectivesSpec.scala │ │ ├── DebuggingDirectivesSpec.scala │ │ ├── ExecutionDirectivesSpec.scala │ │ ├── FileAndResourceDirectivesSpec.scala │ │ ├── FileAndResourceDirectivesSymlinkSpec.scala │ │ ├── FileUploadDirectivesSpec.scala │ │ ├── FormFieldDirectivesSpec.scala │ │ ├── FutureDirectivesSpec.scala │ │ ├── HeaderDirectivesSpec.scala │ │ ├── HostDirectivesSpec.scala │ │ ├── IllegalHeadersIntegrationSpec.scala │ │ ├── MarshallingDirectivesSpec.scala │ │ ├── MethodDirectivesSpec.scala │ │ ├── MiscDirectivesSpec.scala │ │ ├── ParameterDirectivesSpec.scala │ │ ├── PathDirectivesSpec.scala │ │ ├── RangeDirectivesSpec.scala │ │ ├── RespondWithDirectivesSpec.scala │ │ ├── RouteDirectivesSpec.scala │ │ ├── SchemeDirectivesSpec.scala │ │ ├── SecurityDirectivesSpec.scala │ │ ├── TimeoutDirectivesSpec.scala │ │ └── WebSocketDirectivesSpec.scala │ └── util │ │ └── TupleOpsSpec.scala │ ├── settings │ └── RoutingSettingsEqualitySpec.scala │ └── unmarshalling │ ├── MultipartUnmarshallersSpec.scala │ ├── UnmarshallingSpec.scala │ └── sse │ ├── BaseUnmarshallingSpec.scala │ ├── EventStreamUnmarshallingSpec.scala │ ├── LineParserSpec.scala │ └── ServerSentEventParserSpec.scala ├── http └── src │ └── main │ ├── boilerplate │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ ├── javadsl │ │ └── server │ │ │ └── JavaPathMatchers.scala.template │ │ └── scaladsl │ │ └── server │ │ ├── directives │ │ ├── FormFieldDirectivesInstances.scala.template │ │ └── ParameterDirectivesInstances.scala.template │ │ └── util │ │ ├── ApplyConverterInstances.scala.template │ │ ├── ConstructFromTupleInstances.scala.template │ │ ├── TupleAppendOneInstances.scala.template │ │ └── TupleFoldInstances.scala.template │ ├── java │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── javadsl │ │ ├── coding │ │ └── Coder.java │ │ ├── common │ │ └── RegexConverters.java │ │ ├── server │ │ ├── ExceptionHandlerBuilder.java │ │ ├── HttpApp.java │ │ └── directives │ │ │ ├── ContentTypeResolver.java │ │ │ └── CorrespondsTo.java │ │ └── unmarshalling │ │ ├── StringUnmarshallers.java │ │ └── Unmarshallers.java │ ├── resources │ └── reference.conf │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ ├── impl │ └── settings │ │ ├── RoutingSettingsImpl.scala │ │ └── ServerSentEventSettingsImpl.scala │ ├── javadsl │ ├── common │ │ ├── EntityStreamingSupport.scala │ │ └── PartialApplication.scala │ ├── marshalling │ │ ├── Marshaller.scala │ │ └── sse │ │ │ └── EventStreamMarshalling.scala │ ├── server │ │ ├── Directives.scala │ │ ├── ExceptionHandler.scala │ │ ├── PathMatchers.scala │ │ ├── RejectionHandler.scala │ │ ├── Rejections.scala │ │ ├── RequestContext.scala │ │ ├── Route.scala │ │ ├── RouteResult.scala │ │ ├── RoutingJavaMapping.scala │ │ └── directives │ │ │ ├── AttributeDirectives.scala │ │ │ ├── BasicDirectives.scala │ │ │ ├── CacheConditionDirectives.scala │ │ │ ├── CodingDirectives.scala │ │ │ ├── CookieDirectives.scala │ │ │ ├── DebuggingDirectives.scala │ │ │ ├── ExecutionDirectives.scala │ │ │ ├── FileAndResourceDirectives.scala │ │ │ ├── FileUploadDirectives.scala │ │ │ ├── FormFieldDirectives.scala │ │ │ ├── FramedEntityStreamingDirectives.scala │ │ │ ├── FutureDirectives.scala │ │ │ ├── HeaderDirectives.scala │ │ │ ├── HostDirectives.scala │ │ │ ├── MarshallingDirectives.scala │ │ │ ├── MethodDirectives.scala │ │ │ ├── MiscDirectives.scala │ │ │ ├── ParameterDirectives.scala │ │ │ ├── PathDirectives.scala │ │ │ ├── RangeDirectives.scala │ │ │ ├── RespondWithDirectives.scala │ │ │ ├── RouteAdapter.scala │ │ │ ├── RouteDirectives.scala │ │ │ ├── SchemeDirectives.scala │ │ │ ├── SecurityDirectives.scala │ │ │ ├── TimeoutDirectives.scala │ │ │ └── WebSocketDirectives.scala │ ├── settings │ │ ├── RoutingSettings.scala │ │ └── ServerSentEventSettings.scala │ └── unmarshalling │ │ ├── StringUnmarshaller.scala │ │ ├── Unmarshaller.scala │ │ └── sse │ │ └── EventStreamUnmarshalling.scala │ └── scaladsl │ ├── client │ ├── RequestBuilding.scala │ └── TransformerPipelineSupport.scala │ ├── coding │ ├── Coder.scala │ ├── Coders.scala │ ├── DataMapper.scala │ ├── Decoder.scala │ ├── Deflate.scala │ ├── DeflateCompressor.scala │ ├── Encoder.scala │ ├── Gzip.scala │ ├── GzipCompressor.scala │ └── NoCoding.scala │ ├── common │ ├── CsvEntityStreamingSupport.scala │ ├── EntityStreamingSupport.scala │ ├── JsonEntityStreamingSupport.scala │ ├── NameReceptacle.scala │ └── StrictForm.scala │ ├── marshalling │ ├── ContentTypeOverrider.scala │ ├── EmptyValue.scala │ ├── GenericMarshallers.scala │ ├── Marshal.scala │ ├── Marshaller.scala │ ├── MultipartMarshallers.scala │ ├── PredefinedToEntityMarshallers.scala │ ├── PredefinedToRequestMarshallers.scala │ ├── PredefinedToResponseMarshallers.scala │ ├── ToResponseMarshallable.scala │ ├── package.scala │ └── sse │ │ └── EventStreamMarshalling.scala │ ├── server │ ├── ContentNegotiation.scala │ ├── Directive.scala │ ├── Directives.scala │ ├── ExceptionHandler.scala │ ├── HttpApp.scala │ ├── PathMatcher.scala │ ├── Rejection.scala │ ├── RejectionHandler.scala │ ├── RequestContext.scala │ ├── RequestContextImpl.scala │ ├── Route.scala │ ├── RouteConcatenation.scala │ ├── RouteResult.scala │ ├── RoutingLog.scala │ ├── StandardRoute.scala │ ├── directives │ │ ├── AttributeDirectives.scala │ │ ├── BasicDirectives.scala │ │ ├── CacheConditionDirectives.scala │ │ ├── CodingDirectives.scala │ │ ├── CookieDirectives.scala │ │ ├── DebuggingDirectives.scala │ │ ├── ExecutionDirectives.scala │ │ ├── FileAndResourceDirectives.scala │ │ ├── FileUploadDirectives.scala │ │ ├── FormFieldDirectives.scala │ │ ├── FramedEntityStreamingDirectives.scala │ │ ├── FutureDirectives.scala │ │ ├── HeaderDirectives.scala │ │ ├── HostDirectives.scala │ │ ├── MarshallingDirectives.scala │ │ ├── MethodDirectives.scala │ │ ├── MiscDirectives.scala │ │ ├── ParameterDirectives.scala │ │ ├── PathDirectives.scala │ │ ├── RangeDirectives.scala │ │ ├── RespondWithDirectives.scala │ │ ├── RouteDirectives.scala │ │ ├── SchemeDirectives.scala │ │ ├── SecurityDirectives.scala │ │ ├── TimeoutDirectives.scala │ │ └── WebSocketDirectives.scala │ ├── package.scala │ └── util │ │ ├── ApplyConverter.scala │ │ ├── BinaryPolyFunc.scala │ │ ├── ClassMagnet.scala │ │ ├── ConstructFromTuple.scala │ │ ├── Tuple.scala │ │ ├── TupleOps.scala │ │ └── Tupler.scala │ ├── settings │ ├── RoutingSettings.scala │ └── ServerSentEventSettings.scala │ └── unmarshalling │ ├── GenericUnmarshallers.scala │ ├── MultipartUnmarshallers.scala │ ├── PredefinedFromEntityUnmarshallers.scala │ ├── PredefinedFromStringUnmarshallers.scala │ ├── Unmarshal.scala │ ├── Unmarshaller.scala │ ├── package.scala │ └── sse │ ├── EventStreamParser.scala │ ├── EventStreamUnmarshalling.scala │ ├── LineParser.scala │ └── ServerSentEventParser.scala ├── http2-tests └── src │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── pekko │ │ └── http │ │ └── javadsl │ │ └── Http2JavaServerTest.java │ └── scala │ └── org │ └── apache │ └── pekko │ └── http │ ├── impl │ └── engine │ │ └── http2 │ │ ├── H2SpecIntegrationSpec.scala │ │ ├── H2cUpgradeSpec.scala │ │ ├── HPackEncodingSupport.scala │ │ ├── HPackSpecExamples.scala │ │ ├── Http2ClientServerSpec.scala │ │ ├── Http2ClientSpec.scala │ │ ├── Http2FrameHpackSupport.scala │ │ ├── Http2FrameProbe.scala │ │ ├── Http2FrameSending.scala │ │ ├── Http2PersistentClientSpec.scala │ │ ├── Http2ServerDemuxSpec.scala │ │ ├── Http2ServerDisableFrameTypeThrottleSpec.scala │ │ ├── Http2ServerEnableFrameTypeThrottleSpec.scala │ │ ├── Http2ServerSpec.scala │ │ ├── Http2SpecWithMaterializer.scala │ │ ├── HttpMessageRenderingSpec.scala │ │ ├── PriorityTreeSpec.scala │ │ ├── ProtocolSwitchSpec.scala │ │ ├── RequestParsingSpec.scala │ │ ├── TelemetrySpiSpec.scala │ │ ├── WindowTracking.scala │ │ ├── WithPriorKnowledgeSpec.scala │ │ ├── framing │ │ └── Http2FramingSpec.scala │ │ └── package.scala │ └── scaladsl │ └── Http2ServerTest.scala ├── legal ├── CorsNotice.txt ├── PekkoNotice.txt └── StandardLicense.txt ├── parsing └── src │ └── main │ ├── scala-2 │ └── org │ │ └── apache │ │ └── pekko │ │ ├── http │ │ └── ccompat │ │ │ ├── pre213macro.scala │ │ │ └── since213macro.scala │ │ └── macros │ │ └── LogHelperMacro.scala │ ├── scala-3 │ └── org │ │ └── apache │ │ └── pekko │ │ ├── http │ │ └── ccompat │ │ │ ├── pre213macro.scala │ │ │ └── since213macro.scala │ │ └── macros │ │ └── LogHelperMacro.scala │ └── scala │ └── org │ └── apache │ └── pekko │ └── macros │ └── LogHelper.scala ├── project ├── AddMetaInfLicenseFiles.scala ├── AutomaticModuleName.scala ├── CliOptions.scala ├── Common.scala ├── CopyrightHeader.scala ├── Dependencies.scala ├── Doc.scala ├── GitHub.scala ├── LicenseReport.scala ├── MultiNode.scala ├── NoScala3.scala ├── ParadoxSupport.scala ├── PekkoCoreDependency.scala ├── Pre213Preprocessor.scala ├── Publish.scala ├── SbtInternalAccess.scala ├── Untar.scala ├── ValidatePullRequest.scala ├── VersionGenerator.scala ├── build.properties ├── plugins.sbt └── project-info.conf └── scripts └── link-validator.conf /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # scalafmt 2 | 90f8bf7e6d6f7a2d6c63313944613a95ff60091a 3 | a22568ac12002cec0694c5e1fb02f76309966f88 4 | 5 | # javafmt 6 | 8d11f7fb91d7bbea9b2758d528d01d5e4c88ff13 7 | b6e4bd242e5e5657f2bb17478c98abb06641eeae 8 | 9 | # manual 10 | 8093f01074103e542f12c228c3720f9f9a06a53e 11 | ba209d86f235ad43cf7d5e0eaf941489058c90c8 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Activate line ending normalization, setting eol will make the behavior match core.autocrlf = input 2 | * text=auto eol=lf 3 | # Force batch scripts to always use CRLF line endings 4 | *.{cmd,[cC][mM][dD]} text eol=crlf 5 | *.{bat,[bB][aA][tT]} text eol=crlf 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/---bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41B Bug report" 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/---feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F389 Feature request" 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/---question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "❓ Question" 3 | about: Please use the Pekko User mailing list for questions: https://lists.apache.org/list.html?users@pekko.apache.org 4 | 5 | --- 6 | 7 | Please use the Pekko User mailing list for questions: https://lists.apache.org/list.html?users@pekko.apache.org instead 8 | of the Github issue tracker for questions. -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | .DS_Store 3 | target 4 | 5 | *.orig 6 | 7 | *# 8 | *~ 9 | .#* 10 | .*.swp 11 | *.vim 12 | .ensime* 13 | .bsp 14 | -------------------------------------------------------------------------------- /.jvmopts: -------------------------------------------------------------------------------- 1 | -Xmx4g 2 | -Duser.language=en_US.UTF-8 3 | -Dfile.encoding=en_US.UTF-8 4 | -Dsun.jnu.encoding=UTF-8 5 | -------------------------------------------------------------------------------- /.jvmopts-ci: -------------------------------------------------------------------------------- 1 | -verbose:gc 2 | -Xmx4g 3 | -Duser.language=en_US.UTF-8 4 | -Dfile.encoding=en_US.UTF-8 5 | -Dsun.jnu.encoding=UTF-8 6 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Apache Pekko HTTP Releases 2 | 3 | The [Release Notes](https://pekko.apache.org/docs/pekko-http/current/release-notes/index.html) are available on the Apache Pekko web site. 4 | 5 | ## GitHub Compare 6 | 7 | GitHub has a feature allowing you to compare 2 Git tags and see the PRs and overall code diff. You can take the example URL below and tweak it with the version tags that you want to compare. 8 | 9 | https://github.com/apache/pekko-http/compare/v1.0.0...v1.0.1-RC1 10 | -------------------------------------------------------------------------------- /docs/src/main/paradox/.htaccess: -------------------------------------------------------------------------------- 1 | # Since Akka HTTP 10.0.9 2 | RedirectMatch 301 ^(.*)/common/de-coding.html$ $1/common/encoding.html 3 | RedirectMatch 301 ^(.*)/low-level-server-side-api.html$ $1/server-side/low-level-api.html 4 | RedirectMatch 301 ^(.*)/server-side-https-support.html$ $1/server-side/https-support.html 5 | RedirectMatch 301 ^(.*)/routing-dsl/marshalling.html$ $1/common/marshalling.html 6 | # Root at (java|scala)/http to avoid loops. 7 | RedirectMatch 301 ^(.*)/http/websocket-support.html$ $1/http/server-side/websocket-support.html 8 | 9 | RedirectMatch 301 ^(.*)/formFieldList.html$ $1/formFieldSeq.html 10 | RedirectMatch 301 ^(.*)/extractHostName.html$ $1/extractHost.html 11 | 12 | RedirectMatch 301 ^(.*)/release-notes.html$ $1/release-notes/ 13 | 14 | RedirectMatch 301 ^(.*)/scala/http/(.*)$ $1/$2?language=scala 15 | RedirectMatch 301 ^(.*)/java/http/(.*)$ $1/$2?language=java 16 | 17 | RedirectMatch 301 ^(.*)/routing-dsl/directives/file-upload-directives/uploadedFile.html$ $1/routing-dsl/directives/file-upload-directives/storeUploadedFile.html 18 | -------------------------------------------------------------------------------- /docs/src/main/paradox/DispatcherBehaviourOnBadCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/docs/src/main/paradox/DispatcherBehaviourOnBadCode.png -------------------------------------------------------------------------------- /docs/src/main/paradox/DispatcherBehaviourOnGoodCode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/docs/src/main/paradox/DispatcherBehaviourOnGoodCode.png -------------------------------------------------------------------------------- /docs/src/main/paradox/common/index.md: -------------------------------------------------------------------------------- 1 | # 3. Data Types & Abstractions 2 | 3 | HTTP and related specifications define a great number of concepts and functionality that is not specific to either 4 | HTTP's client- or server-side since they are meaningful on both end of an HTTP connection. 5 | The documentation for their counterparts in Apache Pekko HTTP lives in this section rather than in the ones for the 6 | @ref[Client-Side API](../client-side/index.md), @ref[Core Server API](../server-side/low-level-api.md) or @ref[High-level Server-Side API](../routing-dsl/index.md), 7 | which are specific to one side only. 8 | 9 | @@toc { depth=3 } 10 | 11 | @@@ index 12 | 13 | * [http-model](http-model.md) 14 | * [uri-model](uri-model.md) 15 | * [marshalling](marshalling.md) 16 | * [unmarshalling](unmarshalling.md) 17 | * [encoding](encoding.md) 18 | * [json-support](json-support.md) 19 | * [xml-support](xml-support.md) 20 | * [xml-support](sse-support.md) 21 | * [timeouts](timeouts.md) 22 | * [caching](caching.md) 23 | * [cors](cors.md) 24 | 25 | @@@ 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/configuration.md: -------------------------------------------------------------------------------- 1 | # Configuration 2 | 3 | Just like any other Apache Pekko module, Apache Pekko HTTP is configured via [Typesafe Config](https://github.com/lightbend/config). 4 | Usually this means that you provide an `application.conf` which contains all the application-specific settings that 5 | differ from the default ones provided by the reference configuration files from the individual Apache Pekko modules. 6 | 7 | These are the relevant default configuration values for the Apache Pekko HTTP modules. 8 | 9 | pekko-http-core 10 | : @@snip [reference.conf](/http-core/src/main/resources/reference.conf) 11 | 12 | pekko-http 13 | : @@snip [reference.conf](/http/src/main/resources/reference.conf) 14 | 15 | pekko-http-caching 16 | : @@snip [reference.conf](/http-caching/src/main/resources/reference.conf) 17 | 18 | pekko-http-cors 19 | : @@snip [reference.conf](/http-cors/src/main/resources/reference.conf) 20 | 21 | The other Apache Pekko HTTP modules do not offer any configuration via [Typesafe Config](https://github.com/lightbend/config). 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/index.md: -------------------------------------------------------------------------------- 1 | # Apache Pekko HTTP 2 | 3 | @@toc { depth=2 } 4 | 5 | @@@ index 6 | 7 | * [Security Announcements](security.md) 8 | * [License Report](license-report.md) 9 | * [Release Notes](release-notes/index.md) 10 | * [introduction](introduction.md) 11 | * [usage](usage.md) 12 | * [common/index](common/index.md) 13 | * [server-side/index](server-side/index.md) 14 | * [client-side/index](client-side/index.md) 15 | * [examples and extensions](examples-and-extensions.md) 16 | * [technologies](technologies.md) 17 | * [tips](tipsandtricks.md) 18 | * [contributing](contributing.md) 19 | * [reference](reference.md) 20 | 21 | @@@ 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/org/apache/pekko-http-file-listing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/docs/src/main/paradox/org/apache/pekko-http-file-listing.png -------------------------------------------------------------------------------- /docs/src/main/paradox/reference.md: -------------------------------------------------------------------------------- 1 | # 10. Reference 2 | 3 | ## API Documentation 4 | 5 | * @scaladoc:[Scaladoc](org.apache.pekko.http.scaladsl.index) 6 | * @javadoc:[Javadoc](org.apache.pekko.http.javadsl.package-summary) 7 | 8 | ## Directives 9 | 10 | * @ref:[Directives By Trait](routing-dsl/directives/by-trait.md) 11 | * @ref:[Directives Alphabetically](routing-dsl/directives/alphabetically.md) 12 | 13 | ## Books 14 | 15 | * The best option is to get a book about [Akka HTTP](https://doc.akka.io/docs/akka-http/current/reference.html). Anything you learn should be useful when it comes to Pekko HTTP. -------------------------------------------------------------------------------- /docs/src/main/paradox/release-notes/index.md: -------------------------------------------------------------------------------- 1 | # 0. Release Notes 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [1.2 Releases](releases-1.2.md) 8 | * [1.1 Releases](releases-1.1.md) 9 | * [1.0 Releases](releases-1.0.md) 10 | 11 | @@@ 12 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/attribute-directives/attribute.md: -------------------------------------------------------------------------------- 1 | # attribute 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [AttributeDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/AttributeDirectives.scala) { #attribute } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the value of the request @ref[attribute](../../../common/http-model.md#attributes) with the given key. 14 | 15 | If no attribute is found for the given key the request 16 | is rejected with a @apidoc[MissingAttributeRejection]. 17 | 18 | If the attribute is expected to be missing in some cases or to customize 19 | handling when the header is missing use the @ref[optionalAttribute](optionalAttribute.md) directive instead. 20 | 21 | ## Example 22 | 23 | Scala 24 | : @@snip [AttributeDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/AttributeDirectivesExamplesSpec.scala) { #attribute } 25 | 26 | Java 27 | : @@snip [AttributeDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/AttributeDirectivesExamplesTest.java) { #attribute } 28 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/attribute-directives/index.md: -------------------------------------------------------------------------------- 1 | # AttributeDirectives 2 | 3 | Attribute directives can be used to extract attribute values from the request. 4 | 5 | @@toc { depth=1 } 6 | 7 | @@@ index 8 | 9 | * [attribute](attribute.md) 10 | * [optionalAttribute](optionalAttribute.md) 11 | 12 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/attribute-directives/optionalAttribute.md: -------------------------------------------------------------------------------- 1 | # optionalAttribute 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [AttributeDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/AttributeDirectives.scala) { #optionalAttribute } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Optionally extracts the value of the request @ref[attribute](../../../common/http-model.md#attributes) with the given key. 14 | 15 | The `optionalAttribute` directive is similar to the @ref[attribute](attribute.md) directive but always extracts 16 | an @scala[`Option`]@java[`Optional`] value instead of rejecting the request if no matching attribute could be found. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [AttributeDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/AttributeDirectivesExamplesSpec.scala) { #optionalAttribute } 22 | 23 | Java 24 | : @@snip [AttributeDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/AttributeDirectivesExamplesTest.java) { #optionalAttribute } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extract.md: -------------------------------------------------------------------------------- 1 | # extract 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extract } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | The `extract` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to extract data from the 14 | @apidoc[RequestContext] and provide it to the inner route. 15 | @scala[It is a special case for extracting one value of the more general @ref[textract](textract.md) directive that can be used to extract more than one value.] 16 | 17 | See @ref[Providing Values to Inner Routes](index.md#providedirectives) for an overview of similar directives. 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extract0 } 23 | 24 | Java 25 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extract } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractActorSystem.md: -------------------------------------------------------------------------------- 1 | # extractActorSystem 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractActorSystem } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the @apidoc[org.apache.pekko.actor.ActorSystem] from the @apidoc[RequestContext], which can be useful when the external API 14 | in your route needs one. 15 | 16 | ## Example 17 | 18 | Scala 19 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractActorSystem-example } 20 | 21 | Java 22 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractActorSystem } 23 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractDataBytes.md: -------------------------------------------------------------------------------- 1 | # extractDataBytes 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractDataBytes } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the entities data bytes as @apidoc[Source[ByteString, \_]] from the @apidoc[RequestContext]. 14 | 15 | The directive returns a stream containing the request data bytes. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractDataBytes-example } 21 | 22 | Java 23 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractDataBytes } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractExecutionContext.md: -------------------------------------------------------------------------------- 1 | # extractExecutionContext 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractExecutionContext } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the `ExecutionContext` from the @apidoc[RequestContext]. 14 | 15 | See @ref[withExecutionContext](withExecutionContext.md) to see how to customise the execution context provided for an inner route. 16 | 17 | See @ref[extract](extract.md) to learn more about how extractions work. 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractExecutionContext-0 } 23 | 24 | Java 25 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractExecutionContext } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractLog.md: -------------------------------------------------------------------------------- 1 | # extractLog 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractLog } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts a @apidoc[LoggingAdapter] from the request context which can be used for logging inside the route. 14 | 15 | The `extractLog` directive is used for providing logging to routes, such that they don't have to depend on 16 | closing over a logger provided in the class body. 17 | 18 | See @ref[extract](extract.md) and @ref[Providing Values to Inner Routes](index.md#providedirectives) for an overview of similar directives. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extract0Log } 24 | 25 | Java 26 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractLog } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractMaterializer.md: -------------------------------------------------------------------------------- 1 | # extractMaterializer 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractMaterializer } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the @apidoc[Materializer] from the @apidoc[RequestContext], which can be useful when you want to run an 14 | Apache Pekko Stream directly in your route. 15 | 16 | See also @ref[withMaterializer](withMaterializer.md) to see how to customise the used materializer for specific inner routes. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractMaterializer-0 } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractMaterializer } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractParserSettings.md: -------------------------------------------------------------------------------- 1 | # extractParserSettings 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractParserSettings } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the request's underlying @apidoc[ParserSettings], which can be useful when you want to access custom status codes and media types. 14 | 15 | ## Example 16 | 17 | Scala 18 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractParserSettings-example } 19 | 20 | Java 21 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractParserSettings } 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractRequest.md: -------------------------------------------------------------------------------- 1 | # extractRequest 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractRequest } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the complete @apidoc[HttpRequest] instance. 14 | 15 | Use `extractRequest` to extract just the complete URI of the request. Usually there's little use of 16 | extracting the complete request because extracting of most of the aspects of HttpRequests is handled by specialized 17 | directives. See @ref[Request Directives](../by-trait.md#request-directives). 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractRequest-example } 23 | 24 | Java 25 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractRequest } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractRequestEntity.md: -------------------------------------------------------------------------------- 1 | # extractRequestEntity 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractRequestEntity } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the @apidoc[RequestEntity] from the @apidoc[RequestContext]. 14 | 15 | The directive returns a @apidoc[RequestEntity] without unmarshalling the request. To extract domain entity, 16 | @ref[entity](../marshalling-directives/entity.md) should be used. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractRequestEntity-example } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractRequestEntity } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractSettings.md: -------------------------------------------------------------------------------- 1 | # extractSettings 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractSettings } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the @apidoc[RoutingSettings] from the @apidoc[RequestContext]. 14 | 15 | By default the settings of the `Http()` extension running the route will be returned. 16 | It is possible to override the settings for specific sub-routes by using the @ref[withSettings](withSettings.md) directive. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractSettings-examples } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractRequestContext } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/extractUri.md: -------------------------------------------------------------------------------- 1 | # extractUri 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #extractUri } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Access the full URI of the request. 14 | 15 | Use @ref[SchemeDirectives](../scheme-directives/index.md), @ref[HostDirectives](../host-directives/index.md), @ref[PathDirectives](../path-directives/index.md), and @ref[ParameterDirectives](../parameter-directives/index.md) for more 16 | targeted access to parts of the URI. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #extractUri-example } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #extractUri } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapInnerRoute.md: -------------------------------------------------------------------------------- 1 | # mapInnerRoute 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapInnerRoute } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Changes the execution model of the inner route by wrapping it with arbitrary logic. 14 | 15 | The `mapInnerRoute` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to replace the inner route 16 | with any other route. Usually, the returned route wraps the original one with custom execution logic. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapInnerRoute } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapInnerRoute } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapResponseEntity.md: -------------------------------------------------------------------------------- 1 | # mapResponseEntity 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapResponseEntity } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | The `mapResponseEntity` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to transform a 14 | response entity that was generated by the inner route. 15 | 16 | See @ref[Response Transforming Directives](index.md#response-transforming-directives) for similar directives. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapResponseEntity } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapResponseEntity } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapResponseHeaders.md: -------------------------------------------------------------------------------- 1 | # mapResponseHeaders 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapResponseHeaders } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Changes the list of response headers that was generated by the inner route. 14 | 15 | The `mapResponseHeaders` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to transform the list of 16 | response headers that was generated by the inner route. 17 | 18 | See @ref[Response Transforming Directives](index.md#response-transforming-directives) for similar directives. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapResponseHeaders } 24 | 25 | Java 26 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapResponseHeaders } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapRouteResult.md: -------------------------------------------------------------------------------- 1 | # mapRouteResult 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapRouteResult } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Changes the message the inner route sends to the responder. 14 | 15 | The `mapRouteResult` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to transform the 16 | @ref[RouteResult](../../routes.md#routeresult) coming back from the inner route. 17 | 18 | See @ref[Result Transformation Directives](index.md#result-transformation-directives) for similar directives. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapRouteResult0 } 24 | 25 | Java 26 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapRouteResult } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapSettings.md: -------------------------------------------------------------------------------- 1 | # mapSettings 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapSettings } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Transforms the @apidoc[RoutingSettings] with a @scala[`RoutingSettings => RoutingSettings` function]@java[`Function`]. 14 | 15 | See also @ref[withSettings](withSettings.md) or @ref[extractSettings](extractSettings.md). 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapSettings-examples } 21 | 22 | Java 23 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapSettings } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/mapUnmatchedPath.md: -------------------------------------------------------------------------------- 1 | # mapUnmatchedPath 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #mapUnmatchedPath } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Transforms the unmatchedPath field of the request context for inner routes. 14 | 15 | The `mapUnmatchedPath` directive is used as a building block for writing @ref[Custom Directives](../custom-directives.md). You can use it 16 | for implementing custom path matching directives. 17 | 18 | Use `extractUnmatchedPath` for extracting the current value of the unmatched path. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #mapUnmatchedPath-example } 24 | 25 | Java 26 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #mapUnmatchedPath } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/pass.md: -------------------------------------------------------------------------------- 1 | # pass 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #pass } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | A directive that passes the request unchanged to its inner route. 14 | 15 | It is usually used as a "neutral element" when combining directives generically. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #pass } 21 | 22 | Java 23 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #pass } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/provide.md: -------------------------------------------------------------------------------- 1 | # provide 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #provide } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Provides a constant value to the inner route. 14 | 15 | The *provide* directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to provide a single value to the 16 | inner route. 17 | @scala[To provide several values use the @ref[tprovide](tprovide.md) directive.] 18 | 19 | See @ref[Providing Values to Inner Routes](index.md#providedirectives) for an overview of similar directives. 20 | 21 | ## Example 22 | 23 | Scala 24 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #provide0 } 25 | 26 | Java 27 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #provide } 28 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/withExecutionContext.md: -------------------------------------------------------------------------------- 1 | # withExecutionContext 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #withExecutionContext } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Allows running an inner route using an alternative `ExecutionContextExecutor` in place of the default one. 14 | 15 | The execution context can be extracted in an inner route using @ref[extractExecutionContext](extractExecutionContext.md) directly, 16 | or used by directives which internally extract the materializer without surfacing this fact in the API. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #withExecutionContext-0 } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #withExecutionContext } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/withLog.md: -------------------------------------------------------------------------------- 1 | # withLog 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #withLog } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Allows running an inner route using an alternative @apidoc[LoggingAdapter] in place of the default one. 14 | 15 | The logging adapter can be extracted in an inner route using @ref[extractLog](extractLog.md) directly, 16 | or used by directives which internally extract the materializer without surfacing this fact in the API. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #withLog0 } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #withLog } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/withMaterializer.md: -------------------------------------------------------------------------------- 1 | # withMaterializer 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #withMaterializer } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Allows running an inner route using an alternative @apidoc[Materializer] in place of the default one. 14 | 15 | The materializer can be extracted in an inner route using @ref[extractMaterializer](extractMaterializer.md) directly, 16 | or used by directives which internally extract the materializer without surfacing this fact in the API 17 | (e.g. responding with a Chunked entity). 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #withMaterializer-0 } 23 | 24 | Java 25 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #withMaterializer } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/basic-directives/withSettings.md: -------------------------------------------------------------------------------- 1 | # withSettings 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [BasicDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/BasicDirectives.scala) { #withSettings } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Allows running an inner route using an alternative @apidoc[RoutingSettings] in place of the default one. 14 | 15 | The execution context can be extracted in an inner route using @ref[extractSettings](extractSettings.md) directly, 16 | or used by directives which internally extract the materializer without surfacing this fact in the API. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [BasicDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/BasicDirectivesExamplesSpec.scala) { #withSettings-0 } 22 | 23 | Java 24 | : @@snip [BasicDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/BasicDirectivesExamplesTest.java) { #withSettings } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cache-condition-directives/index.md: -------------------------------------------------------------------------------- 1 | # CacheConditionDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [conditional](conditional.md) 8 | 9 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/caching-directives/alwaysCache.md: -------------------------------------------------------------------------------- 1 | # alwaysCache 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CachingDirectives.scala](/http-caching/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CachingDirectives.scala) { #alwaysCache } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Like @ref[cache](cache.md) but disregards a `Cache-Control` request header. 14 | 15 | ## Example 16 | 17 | Scala 18 | : @@snip [CachingDirectivesExamplesSpec.scala]($root$/src/test/scala/docs/http/scaladsl/server/directives/CachingDirectivesExamplesSpec.scala) { #always-cache } 19 | 20 | Java 21 | : @@snip [CachingDirectivesExamplesTest.java]($root$/src/test/java/docs/http/javadsl/server/directives/CachingDirectivesExamplesTest.java) { #always-cache } 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/caching-directives/cachingProhibited.md: -------------------------------------------------------------------------------- 1 | # cachingProhibited 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CachingDirectives.scala](/http-caching/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CachingDirectives.scala) { #cachingProhibited } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | This directive is used to filter out requests that forbid caching. It is used as a building block of the @ref[cache](cache.md) directive to prevent caching if the client requests so. 14 | 15 | ## Example 16 | 17 | Scala 18 | : @@snip [HeaderDirectivesExamplesSpec.scala]($root$/src/test/scala/docs/http/scaladsl/server/directives/CachingDirectivesExamplesSpec.scala) { #caching-prohibited } 19 | 20 | Java 21 | : @@snip [CachingDirectivesExamplesTest.java]($root$/src/test/java/docs/http/javadsl/server/directives/CachingDirectivesExamplesTest.java) { #caching-prohibited } 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/coding-directives/index.md: -------------------------------------------------------------------------------- 1 | # CodingDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [decodeRequest](decodeRequest.md) 8 | * [decodeRequestWith](decodeRequestWith.md) 9 | * [encodeResponse](encodeResponse.md) 10 | * [encodeResponseWith](encodeResponseWith.md) 11 | * [requestEncodedWith](requestEncodedWith.md) 12 | * [responseEncodingAccepted](responseEncodingAccepted.md) 13 | * [withPrecompressedMediaTypeSupport](withPrecompressedMediaTypeSupport.md) 14 | 15 | @@@ 16 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/coding-directives/requestEncodedWith.md: -------------------------------------------------------------------------------- 1 | # requestEncodedWith 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CodingDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CodingDirectives.scala) { #requestEncodedWith } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Passes the request to the inner route if the request is encoded with the argument encoding. Otherwise, rejects the request with an `UnacceptedRequestEncodingRejection(encoding)`. 14 | 15 | This directive is the building block for @ref:[decodeRequest](decodeRequest.md) to reject unsupported encodings. 16 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/coding-directives/responseEncodingAccepted.md: -------------------------------------------------------------------------------- 1 | # responseEncodingAccepted 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CodingDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CodingDirectives.scala) { #responseEncodingAccepted } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Passes the request to the inner route if the request accepts the argument encoding. Otherwise, rejects the request with an `UnacceptedResponseEncodingRejection(encoding)`. 14 | 15 | ## Example 16 | 17 | Scala 18 | : @@snip [CodingDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CodingDirectivesExamplesSpec.scala) { #responseEncodingAccepted } 19 | 20 | Java 21 | : @@snip [CodingDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CodingDirectivesExamplesTest.java) { #responseEncodingAccepted } 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/coding-directives/withPrecompressedMediaTypeSupport.md: -------------------------------------------------------------------------------- 1 | # withPrecompressedMediaTypeSupport 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CodingDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CodingDirectives.scala) { #withPrecompressedMediaTypeSupport } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Inspects the response entity and adds a `Content-Encoding: gzip` response header if 14 | the entity's media-type is precompressed with gzip and no `Content-Encoding` header is present yet. 15 | 16 | ## Example 17 | 18 | Scala 19 | : @@snip [CodingDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CodingDirectivesExamplesSpec.scala) { #withPrecompressedMediaTypeSupport } 20 | 21 | Java 22 | : @@snip [CodingDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CodingDirectivesExamplesTest.java) { #withPrecompressedMediaTypeSupport } 23 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cookie-directives/cookie.md: -------------------------------------------------------------------------------- 1 | # cookie 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CookieDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CookieDirectives.scala) { #cookie } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts a cookie with a given name from a request or otherwise rejects the request with a @apidoc[MissingCookieRejection] if 14 | the cookie is missing. 15 | 16 | Use the @ref[optionalCookie](optionalCookie.md) directive instead if you want to support missing cookies in your inner route. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [CookieDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CookieDirectivesExamplesSpec.scala) { #cookie } 22 | 23 | Java 24 | : @@snip [CookieDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java) { #cookie } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cookie-directives/deleteCookie.md: -------------------------------------------------------------------------------- 1 | # deleteCookie 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CookieDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CookieDirectives.scala) { #deleteCookie } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Adds a header to the response to request the removal of the cookie with the given name on the client. 14 | 15 | Use the @ref[setCookie](setCookie.md) directive to update a cookie. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [CookieDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CookieDirectivesExamplesSpec.scala) { #deleteCookie } 21 | 22 | Java 23 | : @@snip [CookieDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java) { #deleteCookie } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cookie-directives/index.md: -------------------------------------------------------------------------------- 1 | # CookieDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [cookie](cookie.md) 8 | * [deleteCookie](deleteCookie.md) 9 | * [optionalCookie](optionalCookie.md) 10 | * [setCookie](setCookie.md) 11 | 12 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cookie-directives/optionalCookie.md: -------------------------------------------------------------------------------- 1 | # optionalCookie 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CookieDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CookieDirectives.scala) { #optionalCookie } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts an optional cookie with a given name from a request. 14 | 15 | Use the @ref[cookie](cookie.md) directive instead if the inner route does not handle a missing cookie. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [CookieDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CookieDirectivesExamplesSpec.scala) { #optionalCookie } 21 | 22 | Java 23 | : @@snip [CookieDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java) { #optionalCookie } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/cookie-directives/setCookie.md: -------------------------------------------------------------------------------- 1 | # setCookie 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [CookieDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CookieDirectives.scala) { #setCookie } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Adds a header to the response to request the update of the cookie with the given name on the client. 14 | 15 | Use the @ref[deleteCookie](deleteCookie.md) directive to delete a cookie. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [CookieDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/CookieDirectivesExamplesSpec.scala) { #setCookie } 21 | 22 | Java 23 | : @@snip [CookieDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java) { #setCookie } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/debugging-directives/index.md: -------------------------------------------------------------------------------- 1 | # DebuggingDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [logRequest](logRequest.md) 8 | * [logRequestResult](logRequestResult.md) 9 | * [logResult](logResult.md) 10 | 11 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/execution-directives/handleExceptions.md: -------------------------------------------------------------------------------- 1 | # handleExceptions 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [ExecutionDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/ExecutionDirectives.scala) { #handleExceptions } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Catches exceptions thrown by the inner route and handles them using the specified @apidoc[ExceptionHandler]. 14 | 15 | Using this directive is an alternative to using a global implicitly defined @apidoc[ExceptionHandler] that 16 | applies to the complete route. 17 | 18 | See @ref[Exception Handling](../../exception-handling.md) for general information about options for handling exceptions. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [ExecutionDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/ExecutionDirectivesExamplesSpec.scala) { #handleExceptions } 24 | 25 | Java 26 | : @@snip [ExecutionDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/ExecutionDirectivesExamplesTest.java) { #handleExceptions } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/execution-directives/handleRejections.md: -------------------------------------------------------------------------------- 1 | # handleRejections 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [ExecutionDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/ExecutionDirectives.scala) { #handleRejections } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Using this directive is an alternative to using a global implicitly defined `RejectionHandler` that 14 | applies to the complete route. 15 | 16 | See @ref[Rejections](../../rejections.md) for general information about options for handling rejections. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [ExecutionDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/ExecutionDirectivesExamplesSpec.scala) { #handleRejections } 22 | 23 | Java 24 | : @@snip [ExecutionDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/ExecutionDirectivesExamplesTest.java) { #handleRejections } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/execution-directives/index.md: -------------------------------------------------------------------------------- 1 | # ExecutionDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [handleExceptions](handleExceptions.md) 8 | * [handleRejections](handleRejections.md) 9 | 10 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/file-upload-directives/index.md: -------------------------------------------------------------------------------- 1 | # FileUploadDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [fileUpload](fileUpload.md) 8 | * [fileUploadAll](fileUploadAll.md) 9 | * [storeUploadedFile](storeUploadedFile.md) 10 | * [storeUploadedFiles](storeUploadedFiles.md) 11 | 12 | @@@ 13 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/file-upload-directives/storeUploadedFiles.md: -------------------------------------------------------------------------------- 1 | 2 | # storeUploadedFiles 3 | 4 | @@@ div { .group-scala } 5 | ## Signature 6 | 7 | @@signature [FileUploadDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/FileUploadDirectives.scala) { #storeUploadedFiles } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Streams the contents of all files uploaded in a multipart form into files on disk and provides a list of each 14 | file and metadata about the upload. 15 | 16 | If there is an error writing to disk the request will be failed with the thrown exception. If there is no field 17 | with the given name the request will be rejected. 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [FileUploadDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/FileUploadDirectivesExamplesSpec.scala) { #storeUploadedFiles } 23 | 24 | Java 25 | : @@snip [FileUploadDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/FileUploadDirectivesExamplesTest.java) { #storeUploadedFiles } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/form-field-directives/formField.md: -------------------------------------------------------------------------------- 1 | # formField 2 | 3 | ## Description 4 | 5 | Allows extracting a single Form field sent in the request. Data posted from [HTML Forms](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4) is either of type `application/x-www-form-urlencoded` or of type `multipart/form-data`. 6 | 7 | @scala[See @ref[formFields](formFields.md) for an in-depth description.] 8 | 9 | ## Example 10 | 11 | Scala 12 | : @@snip [FormFieldDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/FormFieldDirectivesExamplesSpec.scala) { #formField } 13 | 14 | Java 15 | : @@snip [FormFieldDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/FormFieldDirectivesExamplesTest.java) { #formField } 16 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/form-field-directives/index.md: -------------------------------------------------------------------------------- 1 | # FormFieldDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [formField](formField.md) 8 | * @scala[[formFields](formFields.md)] 9 | * [formFieldSeq](formFieldSeq.md) 10 | * [formFieldMap](formFieldMap.md) 11 | * [formFieldMultiMap](formFieldMultiMap.md) 12 | 13 | @@@ 14 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/future-directives/index.md: -------------------------------------------------------------------------------- 1 | # FuturesDirectives 2 | 3 | Future directives can be used to run inner routes once the provided @scala[`Future[T]`]@java[`CompletionStage`] has been completed. 4 | 5 | @@toc { depth=1 } 6 | 7 | @@@ index 8 | 9 | * [onComplete](onComplete.md) 10 | * [onCompleteWithBreaker](onCompleteWithBreaker.md) 11 | * [onSuccess](onSuccess.md) 12 | * [completeOrRecoverWith](completeOrRecoverWith.md) 13 | 14 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/header-directives/headerValueByName.md: -------------------------------------------------------------------------------- 1 | # headerValueByName 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [HeaderDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala) { #headerValueByName } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the value of the HTTP request header with the given name. 14 | 15 | If no header with a matching name is found the request 16 | is rejected with a @apidoc[MissingHeaderRejection]. 17 | 18 | If the header is expected to be missing in some cases or to customize 19 | handling when the header is missing use the @ref[optionalHeaderValueByName](optionalHeaderValueByName.md) directive instead. 20 | 21 | ## Example 22 | 23 | Scala 24 | : @@snip [HeaderDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/HeaderDirectivesExamplesSpec.scala) { #headerValueByName-0 } 25 | 26 | Java 27 | : @@snip [HeaderDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/HeaderDirectivesExamplesTest.java) { #headerValueByName } 28 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/header-directives/index.md: -------------------------------------------------------------------------------- 1 | # HeaderDirectives 2 | 3 | Header directives can be used to extract header values from the request. To change 4 | response headers use one of the @ref[RespondWithDirectives](../respond-with-directives/index.md). 5 | 6 | @@toc { depth=1 } 7 | 8 | @@@ index 9 | 10 | * [headerValue](headerValue.md) 11 | * [headerValueByName](headerValueByName.md) 12 | * [headerValueByType](headerValueByType.md) 13 | * [headerValuePF](headerValuePF.md) 14 | * [optionalHeaderValue](optionalHeaderValue.md) 15 | * [optionalHeaderValueByName](optionalHeaderValueByName.md) 16 | * [optionalHeaderValueByType](optionalHeaderValueByType.md) 17 | * [optionalHeaderValuePF](optionalHeaderValuePF.md) 18 | * [checkSameOrigin](checkSameOrigin.md) 19 | 20 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/header-directives/optionalHeaderValueByName.md: -------------------------------------------------------------------------------- 1 | # optionalHeaderValueByName 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [HeaderDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala) { #optionalHeaderValueByName } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Optionally extracts the value of the HTTP request header with the given name. 14 | 15 | The `optionalHeaderValueByName` directive is similar to the @ref[headerValueByName](headerValueByName.md) directive but always extracts 16 | an @scala[`Option`]@java[`Optional`] value instead of rejecting the request if no matching header could be found. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [HeaderDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/HeaderDirectivesExamplesSpec.scala) { #optionalHeaderValueByName-0 } 22 | 23 | Java 24 | : @@snip [HeaderDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/HeaderDirectivesExamplesTest.java) { #optionalHeaderValueByName } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/header-directives/optionalHeaderValuePF.md: -------------------------------------------------------------------------------- 1 | # optionalHeaderValuePF 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [HeaderDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala) { #optionalHeaderValuePF } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Calls the specified partial function with the first request header the function is `isDefinedAt` and extracts the 14 | result of calling the function. 15 | 16 | The `optionalHeaderValuePF` directive is similar to the @ref[headerValuePF](headerValuePF.md) directive but always extracts an @scala[`Option`]@java[`Optional`] 17 | value instead of rejecting the request if no matching header could be found. 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [HeaderDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/HeaderDirectivesExamplesSpec.scala) { #optionalHeaderValuePF-0 } 23 | 24 | Java 25 | : @@snip [HeaderDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/HeaderDirectivesExamplesTest.java) { #optionalHeaderValuePF } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/host-directives/extractHost.md: -------------------------------------------------------------------------------- 1 | # extractHost 2 | 3 | Extract the hostname part of the `Host` request header and expose it as a `String` extraction 4 | to its inner route. 5 | 6 | @@@ div { .group-scala } 7 | 8 | ## Signature 9 | 10 | @@signature [HostDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HostDirectives.scala) { #extractHost } 11 | 12 | @@@ 13 | 14 | ## Example 15 | 16 | Scala 17 | : @@snip [HostDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/HostDirectivesExamplesSpec.scala) { #extractHost } 18 | 19 | Java 20 | : @@snip [HostDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/HostDirectivesExamplesTest.java) { #extractHostname } 21 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/host-directives/index.md: -------------------------------------------------------------------------------- 1 | # HostDirectives 2 | 3 | HostDirectives allow you to filter requests based on the hostname part of the `Host` header 4 | contained in incoming requests as well as extracting its value for usage in inner routes. 5 | 6 | @@toc { depth=1 } 7 | 8 | @@@ index 9 | 10 | * [host](host.md) 11 | * [extractHost](extractHost.md) 12 | 13 | @@@ 14 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/delete.md: -------------------------------------------------------------------------------- 1 | # delete 2 | 3 | Matches requests with HTTP method `DELETE`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #delete } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters an incoming request by its HTTP method. Only requests with 16 | method `DELETE` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #delete-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #delete } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/get.md: -------------------------------------------------------------------------------- 1 | # get 2 | 3 | Matches requests with HTTP method `GET`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #get } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | method `GET` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #get-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #get } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/index.md: -------------------------------------------------------------------------------- 1 | # MethodDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [delete](delete.md) 8 | * [extractMethod](extractMethod.md) 9 | * [get](get.md) 10 | * [head](head.md) 11 | * [method](method.md) 12 | * [options](options.md) 13 | * [overrideMethodWithParameter](overrideMethodWithParameter.md) 14 | * [patch](patch.md) 15 | * [post](post.md) 16 | * [put](put.md) 17 | 18 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/method.md: -------------------------------------------------------------------------------- 1 | # method 2 | 3 | Matches HTTP requests based on their method. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #method } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | the specified method are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #method-example } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #method-example } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/options.md: -------------------------------------------------------------------------------- 1 | # options 2 | 3 | Matches requests with HTTP method `OPTIONS`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #options } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | method `OPTIONS` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #options-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #options } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/patch.md: -------------------------------------------------------------------------------- 1 | # patch 2 | 3 | Matches requests with HTTP method `PATCH`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #patch } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | method `PATCH` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #patch-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #patch } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/post.md: -------------------------------------------------------------------------------- 1 | # post 2 | 3 | Matches requests with HTTP method `POST`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #post } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | method `POST` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #post-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #post } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/method-directives/put.md: -------------------------------------------------------------------------------- 1 | # put 2 | 3 | Matches requests with HTTP method `PUT`. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MethodDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MethodDirectives.scala) { #put } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | This directive filters the incoming request by its HTTP method. Only requests with 16 | method `PUT` are passed on to the inner route. All others are rejected with a 17 | @apidoc[MethodRejection], which is translated into a `405 Method Not Allowed` response 18 | by the default @ref[RejectionHandler](../../rejections.md#the-rejectionhandler). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [MethodDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MethodDirectivesExamplesSpec.scala) { #put-method } 24 | 25 | Java 26 | : @@snip [MethodDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MethodDirectivesExamplesTest.java) { #put } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/misc-directives/index.md: -------------------------------------------------------------------------------- 1 | # MiscDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [extractClientIP](extractClientIP.md) 8 | * [rejectEmptyResponse](rejectEmptyResponse.md) 9 | * [requestEntityEmpty](requestEntityEmpty.md) 10 | * [requestEntityPresent](requestEntityPresent.md) 11 | * [selectPreferredLanguage](selectPreferredLanguage.md) 12 | * [validate](validate.md) 13 | * [withoutSizeLimit](withoutSizeLimit.md) 14 | * [withSizeLimit](withSizeLimit.md) 15 | 16 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/misc-directives/rejectEmptyResponse.md: -------------------------------------------------------------------------------- 1 | # rejectEmptyResponse 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [MiscDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MiscDirectives.scala) { #rejectEmptyResponse } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Replaces a response with no content with an empty rejection. 14 | 15 | The `rejectEmptyResponse` directive is mostly used together with marshallers that serialize to an empty response under 16 | certain circumstances. @scala[For example serialization of `None`.] 17 | In many cases this empty serialization should instead be handled as `404 Not Found` which is the effect of using `rejectEmptyResponse`. 18 | 19 | ## Example 20 | 21 | Scala 22 | : @@snip [MiscDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MiscDirectivesExamplesSpec.scala) { #rejectEmptyResponse-example } 23 | 24 | Java 25 | : @@snip [MiscDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MiscDirectivesExamplesTest.java) { #rejectEmptyResponse-example } 26 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/misc-directives/requestEntityEmpty.md: -------------------------------------------------------------------------------- 1 | # requestEntityEmpty 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [MiscDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MiscDirectives.scala) { #requestEntityEmpty } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | A filter that checks if the request entity is empty and only then passes processing to the inner route. 14 | Otherwise, the request is rejected. 15 | 16 | See also @ref[requestEntityPresent](requestEntityPresent.md) for the opposite effect. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [MiscDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MiscDirectivesExamplesSpec.scala) { #requestEntityEmptyPresent-example } 22 | 23 | Java 24 | : @@snip [MiscDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MiscDirectivesExamplesTest.java) { #requestEntity-empty-present-example } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/misc-directives/requestEntityPresent.md: -------------------------------------------------------------------------------- 1 | # requestEntityPresent 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [MiscDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MiscDirectives.scala) { #requestEntityPresent } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | A simple filter that checks if the request entity is present and only then passes processing to the inner route. 14 | Otherwise, the request is rejected with @apidoc[RequestEntityExpectedRejection$]. 15 | 16 | See also @ref[requestEntityEmpty](requestEntityEmpty.md) for the opposite effect. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [MiscDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MiscDirectivesExamplesSpec.scala) { #requestEntityEmptyPresent-example } 22 | 23 | Java 24 | : @@snip [MiscDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MiscDirectivesExamplesTest.java) { #requestEntity-empty-present-example } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/misc-directives/validate.md: -------------------------------------------------------------------------------- 1 | # validate 2 | 3 | Allows validating a precondition before handling a route. 4 | 5 | @@@ div { .group-scala } 6 | 7 | ## Signature 8 | 9 | @@signature [MiscDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/MiscDirectives.scala) { #validate } 10 | 11 | @@@ 12 | 13 | ## Description 14 | 15 | Checks an arbitrary condition and passes control to the inner route if it returns `true`. 16 | Otherwise, rejects the request with a @apidoc[ValidationRejection] containing the given error message. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [MiscDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/MiscDirectivesExamplesSpec.scala) { #validate-example } 22 | 23 | Java 24 | : @@snip [MiscDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/MiscDirectivesExamplesTest.java) { #validate-example } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/parameter-directives/parameter.md: -------------------------------------------------------------------------------- 1 | # parameter 2 | 3 | ## Description 4 | 5 | Extracts a *query* parameter value from the @scala[request]@java[request and provides it to the inner route as a `String`]. 6 | 7 | @scala[In the Scala API, `parameter` is an alias for `parameters` and you can use both directives to extract any number of parameter values.] 8 | For a detailed description about how to extract one or more parameters see @ref[parameters](parameters.md). 9 | 10 | See @ref[When to use which parameter directive?](index.md#which-parameter-directive) to understand when to use which directive. 11 | 12 | ## Example 13 | 14 | Scala 15 | : @@snip [ParameterDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/ParameterDirectivesExamplesSpec.scala) { #example-1 } 16 | 17 | Java 18 | : @@snip [ParameterDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/ParameterDirectivesExamplesTest.java) { #parameter } 19 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/parameter-directives/parameterMap.md: -------------------------------------------------------------------------------- 1 | # parameterMap 2 | 3 | @@@ div { .group-scala } 4 | ## Signature 5 | 6 | @@signature [ParameterDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/ParameterDirectives.scala) { #parameterMap } 7 | 8 | @@@ 9 | 10 | ## Description 11 | 12 | Extracts all parameters at once as a @scala[`Map[String, String]`]@java[`Map`] mapping parameter names to parameter values. 13 | 14 | If a query contains a parameter value several times, the map will contain the last one. 15 | 16 | See also @ref[When to use which parameter directive?](index.md#which-parameter-directive) to understand when to use which directive. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [ParameterDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/ParameterDirectivesExamplesSpec.scala) { #parameterMap } 22 | 23 | Java 24 | : @@snip [ParameterDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/ParameterDirectivesExamplesTest.java) { #parameterMap } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/range-directives/index.md: -------------------------------------------------------------------------------- 1 | # RangeDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [withRangeSupport](withRangeSupport.md) 8 | 9 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/respond-with-directives/index.md: -------------------------------------------------------------------------------- 1 | # RespondWithDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [respondWithDefaultHeader](respondWithDefaultHeader.md) 8 | * [respondWithDefaultHeaders](respondWithDefaultHeaders.md) 9 | * [respondWithHeader](respondWithHeader.md) 10 | * [respondWithHeaders](respondWithHeaders.md) 11 | * [respondWithHeaders](respondWithHeaders.md) 12 | 13 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/respond-with-directives/respondWithHeader.md: -------------------------------------------------------------------------------- 1 | # respondWithHeader 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [RespondWithDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/RespondWithDirectives.scala) { #respondWithHeader } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Adds a given HTTP header to all responses coming back from its inner route. 14 | 15 | This directive transforms @apidoc[HttpResponse] and `ChunkedResponseStart` messages coming back from its inner route by 16 | adding the given @apidoc[HttpHeader] instance to the headers list. 17 | 18 | See also @ref[respondWithHeaders](respondWithHeaders.md) if you'd like to add more than one header. 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [RespondWithDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/RespondWithDirectivesExamplesSpec.scala) { #respondWithHeader-0 } 24 | 25 | Java 26 | : @@snip [RespondWithDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/RespondWithDirectivesExamplesTest.java) { #respondWithHeader } 27 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/route-directives/handleSync.md: -------------------------------------------------------------------------------- 1 | # handleSync 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [RouteDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/RouteDirectives.scala) { #handleSync } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Creates a @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)] 14 | that handles the request using a function or `PartialFunction` from @apidoc[HttpRequest] to a @apidoc[HttpResponse]. 15 | 16 | This directive can be used to include components into a routing tree that have been defined only in terms of the low-level model classes. 17 | 18 | This is a strict version of @ref[handle](handle.md). 19 | 20 | ## Example 21 | 22 | Scala 23 | : @@snip [RouteDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/RouteDirectivesExamplesSpec.scala) { #handleSync-examples-with-PF } -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/scheme-directives/extractScheme.md: -------------------------------------------------------------------------------- 1 | # extractScheme 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [SchemeDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/SchemeDirectives.scala) { #extractScheme } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the Uri scheme (i.e. "`http`", "`https`", etc.) for an incoming request. 14 | 15 | For rejecting a request if it doesn't match a specified scheme name, see the @ref[scheme](scheme.md) directive. 16 | 17 | ## Example 18 | 19 | Scala 20 | : @@snip [SchemeDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/SchemeDirectivesExamplesSpec.scala) { #example-1 } 21 | 22 | Java 23 | : @@snip [SchemeDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/SchemeDirectivesExamplesTest.java) { #extractScheme } 24 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/scheme-directives/index.md: -------------------------------------------------------------------------------- 1 | # SchemeDirectives 2 | 3 | Scheme directives can be used to extract the Uri scheme (i.e. "http", "https", etc.) 4 | from requests or to reject any request that does not match a specified scheme name. 5 | 6 | @@toc { depth=1 } 7 | 8 | @@@ index 9 | 10 | * [extractScheme](extractScheme.md) 11 | * [scheme](scheme.md) 12 | 13 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/security-directives/extractCredentials.md: -------------------------------------------------------------------------------- 1 | # extractCredentials 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [SecurityDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/SecurityDirectives.scala) { #extractCredentials } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | Extracts the potentially present @apidoc[HttpCredentials] provided with the request's @apidoc[Authorization] header, 14 | which can be then used to implement some custom authentication or authorization logic. 15 | 16 | See @ref[Credentials and password timing attacks](index.md#credentials-and-timing-attacks) for details about verifying the secret. 17 | 18 | ## Example 19 | 20 | Scala 21 | : @@snip [SecurityDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/SecurityDirectivesExamplesSpec.scala) { #extractCredentials0 } 22 | 23 | Java 24 | : @@snip [SecurityDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/SecurityDirectivesExamplesTest.java) { #extractCredentials } 25 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/timeout-directives/index.md: -------------------------------------------------------------------------------- 1 | # TimeoutDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [extractRequestTimeout](extractRequestTimeout.md) 8 | * [withRequestTimeout](withRequestTimeout.md) 9 | * [withoutRequestTimeout](withoutRequestTimeout.md) 10 | * [withRequestTimeoutResponse](withRequestTimeoutResponse.md) 11 | 12 | @@@ -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/websocket-directives/extractWebSocketUpgrade.md: -------------------------------------------------------------------------------- 1 | # extractWebSocketUpgrade 2 | 3 | @@@ div { .group-scala } 4 | 5 | ## Signature 6 | 7 | @@signature [WebSocketDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala) { #extractWebSocketUpgrade } 8 | 9 | @@@ 10 | 11 | ## Description 12 | 13 | The `extractWebSocketUpgrade` directive is used as a building block for @ref[Custom Directives](../custom-directives.md) to provide the websocket upgrade information to the inner route. 14 | 15 | ## Example 16 | 17 | Scala 18 | : @@snip [WebSocketDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/WebSocketDirectivesExamplesSpec.scala) { #extractWebSocketUpgrade } 19 | 20 | Java 21 | : @@snip [WebSocketDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java) { #extractWebSocketUpgrade } 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/routing-dsl/directives/websocket-directives/index.md: -------------------------------------------------------------------------------- 1 | # WebSocketDirectives 2 | 3 | @@toc { depth=1 } 4 | 5 | @@@ index 6 | 7 | * [extractOfferedWsProtocols](extractOfferedWsProtocols.md) 8 | * [extractUpgradeToWebSocket](extractUpgradeToWebSocket.md) 9 | * [extractWebSocketUpgrade](extractWebSocketUpgrade.md) 10 | * [handleWebSocketMessages](handleWebSocketMessages.md) 11 | * [handleWebSocketMessagesForOptionalProtocol](handleWebSocketMessagesForOptionalProtocol.md) 12 | * [handleWebSocketMessagesForProtocol](handleWebSocketMessagesForProtocol.md) 13 | 14 | @@@ 15 | -------------------------------------------------------------------------------- /docs/src/main/paradox/security.md: -------------------------------------------------------------------------------- 1 | # ! Security Announcements ! 2 | 3 | ## Receiving Security Advisories 4 | The best way to receive any and all security announcements is to subscribe to the [Apache Announce Mailing List](https://lists.apache.org/list.html?announce@apache.org). 5 | 6 | This mailing list has a reasonable level of traffic, and receives notifications only after security reports have been managed by the core Apache teams and fixes are publicly available. 7 | 8 | This mailing list also has announcements of releases for Apache projects. 9 | 10 | ## Reporting Vulnerabilities 11 | 12 | We strongly encourage people to report such problems to our private security mailing list first, before disclosing them in a public forum. 13 | 14 | Please follow the [guidelines](https://www.apache.org/security/) laid down by the Apache Security team. 15 | 16 | Ideally, any issues affecting Apache Pekko and Akka should be reported to Apache team first. We will share the 17 | report with the Lightbend Akka team. 18 | 19 | ## References 20 | 21 | * [Akka HTTP security fixes](https://doc.akka.io/docs/akka-http/10.2/security.html) 22 | -------------------------------------------------------------------------------- /docs/src/main/paradox/tipsandtricks.md: -------------------------------------------------------------------------------- 1 | # 8. Tips And Tricks 2 | 3 | There are few recurring questions that we want to answer in more depth. 4 | 5 | @@toc { depth=2 } 6 | 7 | @@@ index 8 | 9 | * [troubleshooting](troubleshooting/index.md) 10 | * [blocking](handling-blocking-operations-in-pekko-http-routes.md) 11 | * [streaming](implications-of-streaming-http-entity.md) 12 | * [pool-overflow](client-side/pool-overflow.md) 13 | 14 | @@@ 15 | -------------------------------------------------------------------------------- /docs/src/main/paradox/troubleshooting/index.md: -------------------------------------------------------------------------------- 1 | # Troubleshooting 2 | 3 | @@toc { depth=2 } 4 | 5 | @@@ index 6 | 7 | * [Unsupported HTTP method: PRI](unsupported-http-method-pri.md) 8 | 9 | @@@ 10 | -------------------------------------------------------------------------------- /docs/src/main/paradox/troubleshooting/unsupported-http-method-pri.md: -------------------------------------------------------------------------------- 1 | # Unsupported HTTP method: PRI 2 | 3 | ``` 4 | Illegal request, responding with status '501 Not Implemented': Unsupported HTTP method: PRI 5 | ``` 6 | 7 | This indicates that an HTTP/2 request was received, but the server was not 8 | correctly set up to handle those. You may have to: 9 | 10 | * Make sure the @ref[`pekko.http.server.preview.enable-http2` option](../server-side/http2.md#enable-http-2-support) is enabled 11 | * Make sure you are running @ref[at least JDK version 8u252](../server-side/http2.md) 12 | * Make sure you are not using @apidoc[Http().bindAndHandle()](Http$) or @apidoc[Http().newServerAt().bindFlow()](ServerBuilder), but @apidoc[Http().newServerAt().bind()](ServerBuilder). 13 | -------------------------------------------------------------------------------- /docs/src/main/paradox/usage.md: -------------------------------------------------------------------------------- 1 | # 2. Usage 2 | 3 | @@toc { depth=2 } 4 | 5 | @@@ index 6 | 7 | * [configuration](configuration.md) 8 | * [migration-guides](migration-guide/index.md) 9 | * [Compatibility Guidelines](compatibility-guidelines.md) 10 | 11 | @@@ -------------------------------------------------------------------------------- /docs/src/test/java/docs/http/javadsl/server/testkit/MyAppFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package docs.http.javadsl.server.testkit; 15 | // #source-quote 16 | import org.apache.pekko.http.javadsl.server.AllDirectives; 17 | import org.apache.pekko.http.javadsl.server.Route; 18 | 19 | public class MyAppFragment extends AllDirectives { 20 | 21 | public Route createRoute() { 22 | return 23 | // #fragment 24 | pathEnd(() -> get(() -> complete("Fragments of imagination"))); 25 | // #fragment 26 | } 27 | } 28 | // #source-quote 29 | -------------------------------------------------------------------------------- /docs/src/test/java/docs/http/javadsl/server/testkit/WithTimeoutTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package docs.http.javadsl.server.testkit; 15 | 16 | import org.apache.pekko.http.javadsl.testkit.JUnitRouteTest; 17 | import org.junit.Test; 18 | import scala.concurrent.duration.FiniteDuration; 19 | 20 | import java.util.concurrent.TimeUnit; 21 | 22 | public class WithTimeoutTest extends JUnitRouteTest { 23 | // #timeout-setting 24 | @Override 25 | public FiniteDuration awaitDuration() { 26 | return FiniteDuration.create(5, TimeUnit.SECONDS); 27 | } 28 | // #timeout-setting 29 | 30 | @Test 31 | public void dummy() {} 32 | } 33 | -------------------------------------------------------------------------------- /docs/src/test/resources/application.conf: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | pekko { 4 | # needed because we add pekko-actor-typed here but don't include an slf4j implementation 5 | use-slf4j = off 6 | } 7 | -------------------------------------------------------------------------------- /docs/src/test/scala/docs/CompileOnlySpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package docs 15 | 16 | trait CompileOnlySpec { 17 | 18 | /** 19 | * Given a block of code... does NOT execute it. 20 | * Useful when writing code samples in tests, which should only be compiled. 21 | */ 22 | def compileOnlySpec(body: => Unit) = () 23 | } 24 | -------------------------------------------------------------------------------- /docs/src/test/scala/docs/http/scaladsl/server/FragmentExample.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2018-2022 Lightbend Inc. 12 | */ 13 | 14 | package docs.http.scaladsl.server 15 | 16 | //#source-quote 17 | import org.apache.pekko 18 | import pekko.http.scaladsl.server.Directives._ 19 | import pekko.http.scaladsl.server.Route 20 | 21 | object RouteFragment { 22 | val route: Route = pathEnd { 23 | get { 24 | complete("example") 25 | } 26 | } 27 | } 28 | 29 | object API { 30 | pathPrefix("version") { 31 | RouteFragment.route 32 | } 33 | } 34 | //#source-quote 35 | -------------------------------------------------------------------------------- /http-bench-jmh/README.md: -------------------------------------------------------------------------------- 1 | # Apache Pekko Http Microbenchmarks 2 | 3 | This subproject contains some microbenchmarks parts of Pekko Http. 4 | 5 | You can run them like: 6 | 7 | project http-bench-jmh 8 | jmh:run -i 3 -wi 3 -f 1 .*LineParserBenchmark 9 | 10 | Use 'jmh:run -h' to get an overview of the available options. -------------------------------------------------------------------------------- /http-bench-jmh/src/main/scala/org/apache/pekko/http/impl/engine/ws/MaskingBench.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2020-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.engine.ws 15 | 16 | import org.openjdk.jmh.annotations.Benchmark 17 | 18 | import org.apache.pekko 19 | import pekko.util.ByteString 20 | import pekko.http.CommonBenchmark 21 | 22 | class MaskingBench extends CommonBenchmark { 23 | val data = ByteString(new Array[Byte](10000)) 24 | val mask = 0xFEDCBA09 25 | 26 | @Benchmark 27 | def benchRequestProcessing(): (ByteString, Int) = 28 | FrameEventParser.mask(data, mask) 29 | } 30 | -------------------------------------------------------------------------------- /http-compatibility-tests/README.md: -------------------------------------------------------------------------------- 1 | # Binary backwards compatibility tests module 2 | 3 | * Code to compile against the previous version goes into src/main. 4 | * Test code goes into src/test which will have the current version on the classpath. -------------------------------------------------------------------------------- /http-compatibility-tests/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/CompatFormField.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server 15 | package directives 16 | 17 | import Directives._ 18 | 19 | object CompatFormField { 20 | def oneParameter: Directive1[Int] = 21 | formField("num".as[Int]) 22 | def oneParameterRoute: Route = 23 | oneParameter { num => 24 | complete(num.toString) 25 | } 26 | 27 | def twoParameters: Directive[(String, Int)] = 28 | formFields(("name", "age".as[Int])) 29 | def twoParametersRoute: Route = 30 | twoParameters { (name, age) => 31 | complete(s"$name $age") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/AttributeKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | import org.apache.pekko.annotation.DoNotInherit; 17 | 18 | @DoNotInherit 19 | public abstract class AttributeKey { 20 | public static AttributeKey create(String name, Class clazz) { 21 | return new org.apache.pekko.http.scaladsl.model.AttributeKey(name, clazz); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/BodyPartEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Marker-interface for entity types that can be used in a body part */ 17 | public interface BodyPartEntity extends HttpEntity {} 18 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/ContentTypeRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** 17 | * A data structure that combines an acceptable media range and an acceptable charset range into one 18 | * structure to be used with unmarshalling. 19 | */ 20 | public abstract class ContentTypeRange { 21 | public abstract MediaRange mediaRange(); 22 | 23 | public abstract HttpCharsetRange charsetRange(); 24 | 25 | /** Returns true if this range includes the given content type. */ 26 | public abstract boolean matches(ContentType contentType); 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpCharsetRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Contains constructors to create a HttpCharsetRange. */ 17 | public final class HttpCharsetRanges { 18 | private HttpCharsetRanges() {} 19 | 20 | /** A constant representing the range that matches all charsets. */ 21 | public static final HttpCharsetRange ALL = 22 | org.apache.pekko.http.scaladsl.model.HttpCharsetRange.$times$.MODULE$; 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpProtocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** 17 | * Represents an Http protocol (currently only HTTP/1.0 or HTTP/1.1). See {@link HttpProtocols} for 18 | * the predefined constants for the supported protocols. 19 | * 20 | * @see HttpProtocols for convenience access to often used values. 21 | */ 22 | public abstract class HttpProtocol { 23 | /** Returns the String representation of this protocol. */ 24 | public abstract String value(); 25 | } 26 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/HttpProtocols.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Contains constants of the supported Http protocols. */ 17 | public final class HttpProtocols { 18 | private HttpProtocols() {} 19 | 20 | public static final HttpProtocol HTTP_1_0 = 21 | org.apache.pekko.http.scaladsl.model.HttpProtocols.HTTP$div1$u002E0(); 22 | public static final HttpProtocol HTTP_1_1 = 23 | org.apache.pekko.http.scaladsl.model.HttpProtocols.HTTP$div1$u002E1(); 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/RemoteAddresses.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | public final class RemoteAddresses { 17 | private RemoteAddresses() {} 18 | 19 | public static final RemoteAddress UNKNOWN = 20 | org.apache.pekko.http.scaladsl.model.RemoteAddress.Unknown$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/RequestEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Marker-interface for entity types that can be used in a request */ 17 | public interface RequestEntity extends ResponseEntity {} 18 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/RequestEntityAcceptance.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** 17 | * @see RequestEntityAcceptances for convenience access to often used values. Do not extend this to 18 | * a concrete Java class, as implementation of RequestEntityAcceptation should only exist in 19 | * Scala 20 | */ 21 | public abstract class RequestEntityAcceptance { 22 | public abstract boolean isEntityAccepted(); 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/RequestEntityAcceptances.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | public final class RequestEntityAcceptances { 17 | private RequestEntityAcceptances() {} 18 | 19 | public static final RequestEntityAcceptance Expected = 20 | org.apache.pekko.http.scaladsl.model.RequestEntityAcceptance.Expected$.MODULE$; 21 | public static final RequestEntityAcceptance Tolerated = 22 | org.apache.pekko.http.scaladsl.model.RequestEntityAcceptance.Tolerated$.MODULE$; 23 | public static final RequestEntityAcceptance Disallowed = 24 | org.apache.pekko.http.scaladsl.model.RequestEntityAcceptance.Disallowed$.MODULE$; 25 | } 26 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/ResponseEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Marker-interface for entity types that can be used in a response */ 17 | public interface ResponseEntity extends HttpEntity {} 18 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/UniversalEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model; 15 | 16 | /** Marker-interface for entity types that can be used in any context */ 17 | public interface UniversalEntity extends RequestEntity, ResponseEntity, BodyPartEntity {} 18 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/AccessControlAllowCredentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Access-Control-Allow-Credentials` header. Specification: 18 | * http://www.w3.org/TR/cors/#access-control-allow-credentials-response-header 19 | */ 20 | public abstract class AccessControlAllowCredentials 21 | extends org.apache.pekko.http.scaladsl.model.HttpHeader { 22 | public abstract boolean allow(); 23 | 24 | public static AccessControlAllowCredentials create(boolean allow) { 25 | return new org.apache.pekko.http.scaladsl.model.headers 26 | .Access$minusControl$minusAllow$minusCredentials(allow); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/AccessControlMaxAge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Access-Control-Max-Age` header. Specification: 18 | * http://www.w3.org/TR/cors/#access-control-max-age-response-header 19 | */ 20 | public abstract class AccessControlMaxAge extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract long deltaSeconds(); 22 | 23 | public static AccessControlMaxAge create(long deltaSeconds) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.Access$minusControl$minusMax$minusAge( 25 | deltaSeconds); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Age.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the `Age` header. Specification: http://tools.ietf.org/html/rfc7234#section-5.1 */ 17 | public abstract class Age extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract long deltaSeconds(); 19 | 20 | public static Age create(long deltaSeconds) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.Age(deltaSeconds); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/BasicHttpCredentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class BasicHttpCredentials 17 | extends org.apache.pekko.http.scaladsl.model.headers.HttpCredentials { 18 | public abstract String username(); 19 | 20 | public abstract String password(); 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/CacheDirective.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** @see CacheDirectives for convenience access to often used values. */ 17 | public interface CacheDirective { 18 | String value(); 19 | } 20 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Connection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Connection` header. Specification: 18 | * https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 19 | */ 20 | public abstract class Connection extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract Iterable getTokens(); 22 | 23 | public static Connection create(String... directives) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.Connection( 25 | org.apache.pekko.http.impl.util.Util.convertArray(directives)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/ContentDispositionType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** @see ContentDispositionTypes for convenience access to often used values. */ 17 | public interface ContentDispositionType { 18 | String name(); 19 | } 20 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/ContentLength.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2017-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Content-Length` header. Specification: 18 | * https://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-26#section-3.3.2 19 | */ 20 | public abstract class ContentLength extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract long length(); 22 | } 23 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Date.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.DateTime; 17 | 18 | /** 19 | * Model for the `Date` header. Specification: 20 | * http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-7.1.1.2 21 | */ 22 | public abstract class Date extends org.apache.pekko.http.scaladsl.model.HttpHeader { 23 | public abstract DateTime date(); 24 | 25 | public static Date create(DateTime date) { 26 | return new org.apache.pekko.http.scaladsl.model.headers.Date( 27 | ((org.apache.pekko.http.scaladsl.model.DateTime) date)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/ETag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `ETag` header. Specification: 18 | * http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-2.3 19 | */ 20 | public abstract class ETag extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract EntityTag etag(); 22 | 23 | public static ETag create(EntityTag etag) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.ETag( 25 | ((org.apache.pekko.http.scaladsl.model.headers.EntityTag) etag)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/EntityTagRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.impl.util.Util; 17 | 18 | /** @see EntityTagRanges for convenience access to often used values. */ 19 | public abstract class EntityTagRange { 20 | public static EntityTagRange create(EntityTag... tags) { 21 | return org.apache.pekko.http.scaladsl.model.headers.EntityTagRange.apply( 22 | Util.convertArray(tags)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/EntityTagRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public final class EntityTagRanges { 17 | private EntityTagRanges() {} 18 | 19 | public static final EntityTagRange ALL = 20 | org.apache.pekko.http.scaladsl.model.headers.EntityTagRange.$times$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Expires.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.DateTime; 17 | 18 | /** Model for the `Expires` header. Specification: http://tools.ietf.org/html/rfc7234#section-5.3 */ 19 | public abstract class Expires extends org.apache.pekko.http.scaladsl.model.HttpHeader { 20 | public abstract DateTime date(); 21 | 22 | public static Expires create(DateTime date) { 23 | return new org.apache.pekko.http.scaladsl.model.headers.Expires( 24 | ((org.apache.pekko.http.scaladsl.model.DateTime) date)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpEncoding.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class HttpEncoding { 17 | public abstract String value(); 18 | 19 | public HttpEncodingRange toRange() { 20 | return HttpEncodingRange.create(this); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpEncodingRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public final class HttpEncodingRanges { 17 | private HttpEncodingRanges() {} 18 | 19 | public static final HttpEncodingRange ALL = 20 | org.apache.pekko.http.scaladsl.model.headers.HttpEncodingRange.$times$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpOrigin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.scaladsl.model.headers.HttpOrigin$; 17 | 18 | public abstract class HttpOrigin { 19 | public abstract String scheme(); 20 | 21 | public abstract Host host(); 22 | 23 | public static HttpOrigin create(String scheme, Host host) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.HttpOrigin( 25 | scheme, (org.apache.pekko.http.scaladsl.model.headers.Host) host); 26 | } 27 | 28 | public static HttpOrigin parse(String originString) { 29 | return HttpOrigin$.MODULE$.apply(originString); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpOriginRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.scaladsl.model.headers.HttpOriginRange$; 17 | import org.apache.pekko.http.impl.util.Util; 18 | 19 | /** @see HttpOriginRanges for convenience access to often used values. */ 20 | public abstract class HttpOriginRange { 21 | public abstract boolean matches(HttpOrigin origin); 22 | 23 | public static HttpOriginRange create(HttpOrigin... origins) { 24 | return HttpOriginRange$.MODULE$.apply( 25 | Util.convertArray( 26 | origins)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpOriginRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public final class HttpOriginRanges { 17 | private HttpOriginRanges() {} 18 | 19 | public static final HttpOriginRange ALL = 20 | org.apache.pekko.http.scaladsl.model.headers.HttpOriginRange.$times$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/IfMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `If-Match` header. Specification: 18 | * http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-3.1 19 | */ 20 | public abstract class IfMatch extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract EntityTagRange m(); 22 | 23 | public static IfMatch create(EntityTagRange m) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.If$minusMatch( 25 | ((org.apache.pekko.http.scaladsl.model.headers.EntityTagRange) m)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/IfNoneMatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `If-None-Match` header. Specification: 18 | * http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-3.2 19 | */ 20 | public abstract class IfNoneMatch extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract EntityTagRange m(); 22 | 23 | public static IfNoneMatch create(EntityTagRange m) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.If$minusNone$minusMatch( 25 | ((org.apache.pekko.http.scaladsl.model.headers.EntityTagRange) m)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Language.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.impl.util.Util; 17 | import org.apache.pekko.http.scaladsl.model.headers.Language$; 18 | 19 | public abstract class Language { 20 | public static Language create(String primaryTag, String... subTags) { 21 | return Language$.MODULE$.apply(primaryTag, Util.convertArray(subTags)); 22 | } 23 | 24 | public abstract String primaryTag(); 25 | 26 | public abstract Iterable getSubTags(); 27 | 28 | public abstract LanguageRange withQValue(float qValue); 29 | } 30 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/LanguageRange.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public interface LanguageRange { 17 | public abstract String primaryTag(); 18 | 19 | public abstract float qValue(); 20 | 21 | public abstract boolean matches(Language language); 22 | 23 | public abstract Iterable getSubTags(); 24 | 25 | public abstract LanguageRange withQValue(float qValue); 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/LanguageRanges.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public class LanguageRanges { 17 | private LanguageRanges() {} 18 | 19 | public static final LanguageRange ALL = 20 | org.apache.pekko.http.scaladsl.model.headers.LanguageRange.$times$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/LastModified.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.DateTime; 17 | 18 | /** 19 | * Model for the `Last-Modified` header. Specification: 20 | * http://tools.ietf.org/html/draft-ietf-httpbis-p4-conditional-26#section-2.2 21 | */ 22 | public abstract class LastModified extends org.apache.pekko.http.scaladsl.model.HttpHeader { 23 | public abstract DateTime date(); 24 | 25 | public static LastModified create(DateTime date) { 26 | return new org.apache.pekko.http.scaladsl.model.headers.Last$minusModified( 27 | ((org.apache.pekko.http.scaladsl.model.DateTime) date)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Link.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the `Link` header. Specification: http://tools.ietf.org/html/rfc5988#section-5 */ 17 | public abstract class Link extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract Iterable getValues(); 19 | 20 | public static Link create(LinkValue... values) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.Link( 22 | org.apache.pekko.http.impl.util.Util 23 | .convertArray( 24 | values)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/LinkParam.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class LinkParam { 17 | public abstract String key(); 18 | 19 | public abstract Object value(); 20 | } 21 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/LinkValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.Uri; 17 | import org.apache.pekko.http.impl.util.Util; 18 | 19 | public abstract class LinkValue { 20 | public abstract Uri getUri(); 21 | 22 | public abstract Iterable getParams(); 23 | 24 | public static LinkValue create(Uri uri, LinkParam... params) { 25 | return new org.apache.pekko.http.scaladsl.model.headers.LinkValue( 26 | uri.asScala(), 27 | Util.convertArray( 28 | params)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Location.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.Uri; 17 | 18 | /** 19 | * Model for the `Location` header. Specification: 20 | * http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-26#section-7.1.2 21 | */ 22 | public abstract class Location extends org.apache.pekko.http.scaladsl.model.HttpHeader { 23 | public abstract Uri getUri(); 24 | 25 | public static Location create(Uri uri) { 26 | return new org.apache.pekko.http.scaladsl.model.headers.Location(uri.asScala()); 27 | } 28 | 29 | public static Location create(String uri) { 30 | return create(Uri.create(uri)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/OAuth2BearerToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class OAuth2BearerToken 17 | extends org.apache.pekko.http.scaladsl.model.headers.HttpCredentials { 18 | public abstract String token(); 19 | } 20 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Origin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the `Origin` header. Specification: http://tools.ietf.org/html/rfc6454#section-7 */ 17 | public abstract class Origin extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract Iterable getOrigins(); 19 | 20 | public static Origin create(HttpOrigin... origins) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.Origin( 22 | org.apache.pekko.http.impl.util.Util 23 | .convertArray( 24 | origins)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/ProductVersion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class ProductVersion { 17 | public abstract String product(); 18 | 19 | public abstract String version(); 20 | 21 | public abstract String comment(); 22 | 23 | public static ProductVersion create(String product, String version, String comment) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.ProductVersion( 25 | product, version, comment); 26 | } 27 | 28 | public static ProductVersion create(String product, String version) { 29 | return create(product, version, ""); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/ProxyAuthorization.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Proxy-Authorization` header. Specification: 18 | * http://tools.ietf.org/html/draft-ietf-httpbis-p7-auth-26#section-4.4 19 | */ 20 | public abstract class ProxyAuthorization extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract HttpCredentials credentials(); 22 | 23 | public static ProxyAuthorization create(HttpCredentials credentials) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.Proxy$minusAuthorization( 25 | ((org.apache.pekko.http.scaladsl.model.headers.HttpCredentials) credentials)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/RangeUnit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public abstract class RangeUnit { 17 | public abstract String name(); 18 | 19 | public static RangeUnit create(String name) { 20 | return new org.apache.pekko.http.scaladsl.model.headers.RangeUnits.Other(name); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/RangeUnits.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | public final class RangeUnits { 17 | private RangeUnits() {} 18 | 19 | public static final RangeUnit BYTES = 20 | org.apache.pekko.http.scaladsl.model.headers.RangeUnits.Bytes$.MODULE$; 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/RawRequestURI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `Raw-Request-URI` header. Custom header we use for transporting the raw request URI 18 | * either to the application (server-side) or to the request rendering stage (client-side). 19 | */ 20 | public abstract class RawRequestURI extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract String uri(); 22 | 23 | public static RawRequestURI create(String uri) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.Raw$minusRequest$minusURI(uri); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/Referer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.javadsl.model.Uri; 17 | 18 | /** 19 | * Model for the `Referer` header. Specification: http://tools.ietf.org/html/rfc7231#section-5.5.2 20 | */ 21 | public abstract class Referer extends org.apache.pekko.http.scaladsl.model.HttpHeader { 22 | public abstract Uri getUri(); 23 | 24 | public static Referer create(Uri uri) { 25 | return new org.apache.pekko.http.scaladsl.model.headers.Referer(uri.asScala()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/SecWebSocketProtocol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2016-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | import org.apache.pekko.http.impl.util.Util; 17 | 18 | /** Model for the `Sec-WebSocket-Protocol` header. */ 19 | public abstract class SecWebSocketProtocol extends org.apache.pekko.http.scaladsl.model.HttpHeader { 20 | public abstract Iterable getProtocols(); 21 | 22 | public static SecWebSocketProtocol create(String... protocols) { 23 | return new org.apache.pekko.http.scaladsl.model.headers.Sec$minusWebSocket$minusProtocol( 24 | Util.convertArray(protocols)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/SetCookie.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the `Set-Cookie` header. Specification: https://tools.ietf.org/html/rfc6265 */ 17 | public abstract class SetCookie extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract HttpCookie cookie(); 19 | 20 | public static SetCookie create(HttpCookie cookie) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.Set$minusCookie( 22 | ((org.apache.pekko.http.scaladsl.model.headers.HttpCookie) cookie)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/TimeoutAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the synthetic `Timeout-Access` header. */ 17 | public abstract class TimeoutAccess extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract org.apache.pekko.http.javadsl.TimeoutAccess timeoutAccess(); 19 | 20 | public static TimeoutAccess create(org.apache.pekko.http.javadsl.TimeoutAccess timeoutAccess) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.Timeout$minusAccess( 22 | (org.apache.pekko.http.scaladsl.TimeoutAccess) timeoutAccess); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/XForwardedHost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `X-Forwarded-Host` header. Specification: 18 | * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host 19 | */ 20 | public abstract class XForwardedHost extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract org.apache.pekko.http.javadsl.model.Host getHost(); 22 | 23 | public static XForwardedHost create(org.apache.pekko.http.javadsl.model.Host host) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.X$minusForwarded$minusHost( 25 | ((org.apache.pekko.http.scaladsl.model.Uri.Host) host)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/XForwardedProto.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** 17 | * Model for the `X-Forwarded-Proto` header. Specification: 18 | * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto 19 | */ 20 | public abstract class XForwardedProto extends org.apache.pekko.http.scaladsl.model.HttpHeader { 21 | public abstract String getProtocol(); 22 | 23 | public static XForwardedProto create(String protocol) { 24 | return new org.apache.pekko.http.scaladsl.model.headers.X$minusForwarded$minusProto(protocol); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/XRealIp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.headers; 15 | 16 | /** Model for the `X-Real-Ip` header. */ 17 | public abstract class XRealIp extends org.apache.pekko.http.scaladsl.model.HttpHeader { 18 | public abstract org.apache.pekko.http.javadsl.model.RemoteAddress address(); 19 | 20 | public static XRealIp create(org.apache.pekko.http.javadsl.model.RemoteAddress address) { 21 | return new org.apache.pekko.http.scaladsl.model.headers.X$minusReal$minusIp( 22 | ((org.apache.pekko.http.scaladsl.model.RemoteAddress) address)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/mima-filters/1.2.x.backwards.excludes/add-future-await-result-anyval.excludes: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Make AddFutureAwaitResult an AnyVal 19 | ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.pekko.http.impl.util.package.AddFutureAwaitResult") 20 | -------------------------------------------------------------------------------- /http-core/src/main/scala-2.13+/org/apache/pekko/http/ccompat/MapHelpers.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2018-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | object MapHelpers { 17 | def convertMapToScala[K, V](jmap: java.util.Map[K, V]): scala.collection.immutable.Map[K, V] = { 18 | import scala.collection.JavaConverters._ 19 | Map.empty.concat(jmap.asScala) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/scala-2.13+/org/apache/pekko/http/ccompat/imm/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2018-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | /** 17 | * INTERNAL API 18 | */ 19 | package object imm { 20 | // Nothing yet, but present to be source-compatible with 2.13- 21 | } 22 | -------------------------------------------------------------------------------- /http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/MapHelpers.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2018-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | /** 17 | * INTERNAL API 18 | */ 19 | object MapHelpers { 20 | def convertMapToScala[K, V](jmap: java.util.Map[K, V]): scala.collection.immutable.Map[K, V] = { 21 | import scala.collection.JavaConverters._ 22 | Map.empty ++ jmap.asScala 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/scala-2.13-/org/apache/pekko/http/ccompat/imm/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2018-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | import scala.collection.immutable 17 | 18 | /** 19 | * INTERNAL API 20 | */ 21 | package object imm { 22 | implicit class SortedSetOps[A](val real: immutable.SortedSet[A]) extends AnyVal { 23 | def unsorted: immutable.Set[A] = real 24 | } 25 | 26 | implicit class StreamOps[A](val underlying: immutable.Stream[A]) extends AnyVal { 27 | // renamed in 2.13 28 | def lazyAppendedAll[B >: A](rest: => TraversableOnce[B]): Stream[B] = underlying.append(rest) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/engine/client/PoolFlow.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.engine.client 15 | 16 | import org.apache.pekko 17 | import pekko.annotation.InternalApi 18 | import pekko.http.scaladsl.model._ 19 | 20 | import scala.concurrent.Promise 21 | import scala.util.Try 22 | 23 | /** Internal API */ 24 | @InternalApi 25 | private[client] object PoolFlow { 26 | 27 | case class RequestContext(request: HttpRequest, responsePromise: Promise[HttpResponse], retriesLeft: Int) { 28 | require(retriesLeft >= 0) 29 | 30 | def canBeRetried: Boolean = retriesLeft > 0 31 | } 32 | case class ResponseContext(rc: RequestContext, response: Try[HttpResponse]) 33 | } 34 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/engine/ws/Randoms.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.engine.ws 15 | 16 | import java.security.SecureRandom 17 | import java.util.Random 18 | 19 | import org.apache.pekko.annotation.InternalApi 20 | 21 | /** INTERNAL API */ 22 | @InternalApi 23 | private[http] object Randoms { 24 | 25 | /** A factory that creates SecureRandom instances */ 26 | private[http] case object SecureRandomInstances extends (() => Random) { 27 | override def apply(): Random = new SecureRandom() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/settings/ConnectionPoolSetup.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2017-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.settings 15 | 16 | import org.apache.pekko 17 | import pekko.annotation.InternalApi 18 | import pekko.event.LoggingAdapter 19 | import pekko.http.scaladsl.ConnectionContext 20 | import pekko.http.scaladsl.settings.ConnectionPoolSettings 21 | 22 | /** INTERNAL API */ 23 | @InternalApi 24 | private[pekko] final case class ConnectionPoolSetup( 25 | settings: ConnectionPoolSettings, 26 | connectionContext: ConnectionContext = ConnectionContext.noEncryption(), 27 | log: LoggingAdapter) 28 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/settings/HostConnectionPoolSetup.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2017-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.settings 15 | 16 | final case class HostConnectionPoolSetup(host: String, port: Int, setup: ConnectionPoolSetup) 17 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/util/EnhancedByteStringTraversableOnce.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.util 15 | 16 | import org.apache.pekko 17 | import pekko.annotation.InternalApi 18 | import pekko.http.ccompat._ 19 | import pekko.util.ByteString 20 | 21 | /** 22 | * INTERNAL API 23 | */ 24 | @InternalApi 25 | private[http] class EnhancedByteStringTraversableOnce(val byteStrings: IterableOnce[ByteString]) extends AnyVal { 26 | def join: ByteString = byteStrings.foldLeft(ByteString.empty)(_ ++ _) 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/util/EnhancedRegex.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.util 15 | 16 | import org.apache.pekko.annotation.InternalApi 17 | 18 | import scala.util.matching.Regex 19 | 20 | /** 21 | * INTERNAL API 22 | */ 23 | @InternalApi 24 | private[http] class EnhancedRegex(val regex: Regex) extends AnyVal { 25 | def groupCount = regex.pattern.matcher("").groupCount() 26 | } 27 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/impl/util/SingletonException.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.impl.util 15 | 16 | import org.apache.pekko.annotation.InternalApi 17 | 18 | import scala.util.control.NoStackTrace 19 | 20 | /** 21 | * INTERNAL API 22 | * 23 | * Convenience base class for exception objects. 24 | */ 25 | @InternalApi 26 | private[http] abstract class SingletonException(msg: String) extends RuntimeException(msg) with NoStackTrace { 27 | def this() = this(null) 28 | } 29 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/javadsl/HostConnectionPool.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl 15 | 16 | import java.util.concurrent.CompletionStage 17 | 18 | import org.apache.pekko 19 | import pekko.Done 20 | import pekko.annotation.DoNotInherit 21 | import pekko.http.impl.settings.HostConnectionPoolSetup 22 | 23 | @DoNotInherit 24 | abstract class HostConnectionPool private[http] { 25 | def setup: HostConnectionPoolSetup 26 | 27 | /** 28 | * Asynchronously triggers the shutdown of the host connection pool. 29 | * 30 | * The produced [[CompletionStage]] is fulfilled when the shutdown has been completed. 31 | */ 32 | def shutdown(): CompletionStage[Done] 33 | } 34 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/javadsl/OutgoingConnection.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl 15 | 16 | import java.net.InetSocketAddress 17 | 18 | import org.apache.pekko.http.scaladsl 19 | 20 | class OutgoingConnection private[http] (val delegate: scaladsl.Http.OutgoingConnection) { 21 | 22 | /** 23 | * The local address of this connection. 24 | */ 25 | def localAddress: InetSocketAddress = delegate.localAddress 26 | 27 | /** 28 | * The address of the remote peer. 29 | */ 30 | def remoteAddress: InetSocketAddress = delegate.remoteAddress 31 | } 32 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/javadsl/model/SslSessionInfo.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2020-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model 15 | 16 | import javax.net.ssl.SSLSession 17 | 18 | import org.apache.pekko.http.scaladsl.{ model => sm } 19 | 20 | trait SslSessionInfo { 21 | 22 | /** 23 | * Java API 24 | */ 25 | def getSession: SSLSession 26 | } 27 | object SslSessionInfo { 28 | def create(session: SSLSession): SslSessionInfo = sm.SslSessionInfo(session) 29 | } 30 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/javadsl/model/ws/PeerClosedConnectionException.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.model.ws 15 | 16 | /** 17 | * A PeerClosedConnectionException will be reported to the WebSocket handler if the peer has closed the connection. 18 | * `closeCode` and `closeReason` contain close messages as reported by the peer. 19 | */ 20 | trait PeerClosedConnectionException extends RuntimeException { 21 | def closeCode: Int 22 | def closeReason: String 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/AttributeKey.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model 15 | 16 | import org.apache.pekko.http.javadsl.{ model => jm } 17 | 18 | import scala.reflect.ClassTag 19 | 20 | case class AttributeKey[T](name: String, private val clazz: Class[_]) extends jm.AttributeKey[T] 21 | 22 | object AttributeKey { 23 | def apply[T: ClassTag](name: String): AttributeKey[T] = 24 | new AttributeKey[T](name, implicitly[ClassTag[T]].runtimeClass) 25 | } 26 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/AttributeKeys.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model 15 | 16 | import org.apache.pekko.http.scaladsl.model.ws.WebSocketUpgrade 17 | 18 | object AttributeKeys { 19 | val remoteAddress = AttributeKey[RemoteAddress]("remote-address") 20 | val webSocketUpgrade = AttributeKey[WebSocketUpgrade](name = "upgrade-to-websocket") 21 | val sslSession = AttributeKey[SslSessionInfo](name = "ssl-session") 22 | val trailer = AttributeKey[Trailer](name = "trailer") 23 | } 24 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/WithQValue.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model 15 | 16 | /** Helper trait for objects that allow creating new instances with a modified qValue. */ 17 | trait WithQValue[T] { 18 | 19 | /** truncates Double qValue to float and returns a new instance with this qValue set */ 20 | def withQValue(qValue: Double): T = withQValue(qValue.toFloat) 21 | def withQValue(qValue: Float): T 22 | } 23 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/RangeUnit.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.headers 15 | 16 | import org.apache.pekko 17 | import pekko.http.impl.util.{ Rendering, ValueRenderable } 18 | import pekko.http.javadsl.{ model => jm } 19 | 20 | sealed abstract class RangeUnit extends jm.headers.RangeUnit with ValueRenderable { 21 | def name: String 22 | } 23 | 24 | object RangeUnits { 25 | case object Bytes extends RangeUnit { 26 | def name = "Bytes" 27 | 28 | def render[R <: Rendering](r: R): r.type = r ~~ "bytes" 29 | } 30 | 31 | final case class Other(name: String) extends RangeUnit { 32 | def render[R <: Rendering](r: R): r.type = r ~~ name 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/RetryAfterParameter.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.headers 15 | 16 | import org.apache.pekko.http.scaladsl.model._ 17 | 18 | /** 19 | * Defines different values admitted to define a [[`Retry-After`]] header. 20 | * 21 | * Spec: https://tools.ietf.org/html/rfc7231#section-7.1.3 22 | */ 23 | sealed abstract class RetryAfterParameter 24 | final case class RetryAfterDuration(delayInSeconds: Long) extends RetryAfterParameter { 25 | require(delayInSeconds >= 0, "Retry-after header must not contain a negative delay in seconds") 26 | } 27 | final case class RetryAfterDateTime(dateTime: DateTime) extends RetryAfterParameter 28 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/StrictTransportSecurityDirective.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.headers 15 | 16 | import org.apache.pekko.annotation.DoNotInherit 17 | 18 | /** Not for user extension */ 19 | @DoNotInherit 20 | sealed abstract class StrictTransportSecurityDirective 21 | final case class IgnoredDirective(value: String) extends StrictTransportSecurityDirective 22 | case object IncludeSubDomains extends StrictTransportSecurityDirective 23 | final case class MaxAge(value: Long) extends StrictTransportSecurityDirective 24 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/UpgradeProtocol.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.headers 15 | 16 | import org.apache.pekko.http.impl.util.{ Rendering, ValueRenderable } 17 | 18 | final case class UpgradeProtocol(name: String, version: Option[String] = None) extends ValueRenderable { 19 | def render[R <: Rendering](r: R): r.type = { 20 | r ~~ name 21 | version.foreach(v => r ~~ '/' ~~ v) 22 | r 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl 15 | 16 | package object model { 17 | 18 | /** An entity that can be used for every HttpMessage, i.e. for requests and responses. */ 19 | type MessageEntity = RequestEntity 20 | } 21 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/ws/PeerClosedConnectionException.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.ws 15 | 16 | import org.apache.pekko.http.javadsl 17 | 18 | /** 19 | * A PeerClosedConnectionException will be reported to the WebSocket handler if the peer has closed the connection. 20 | * `closeCode` and `closeReason` contain close messages as reported by the peer. 21 | */ 22 | class PeerClosedConnectionException(val closeCode: Int, val closeReason: String) 23 | extends RuntimeException(s"Peer closed connection with code $closeCode '$closeReason'") 24 | with javadsl.model.ws.PeerClosedConnectionException 25 | -------------------------------------------------------------------------------- /http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/ws/WebSocketUpgradeResponse.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.model.ws 15 | 16 | import org.apache.pekko.http.scaladsl.model.HttpResponse 17 | 18 | /** 19 | * Represents the response to a websocket upgrade request. Can either be [[ValidUpgrade]] or [[InvalidUpgradeResponse]]. 20 | */ 21 | sealed trait WebSocketUpgradeResponse { 22 | def response: HttpResponse 23 | } 24 | final case class ValidUpgrade(response: HttpResponse, chosenSubprotocol: Option[String]) 25 | extends WebSocketUpgradeResponse 26 | final case class InvalidUpgradeResponse(response: HttpResponse, cause: String) extends WebSocketUpgradeResponse 27 | -------------------------------------------------------------------------------- /http-core/src/test/java/org/apache/pekko/http/javadsl/settings/ClientConnectionSettingsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.settings; 15 | 16 | import org.apache.pekko.actor.ActorSystem; 17 | import org.junit.Test; 18 | import org.scalatestplus.junit.JUnitSuite; 19 | 20 | public class ClientConnectionSettingsTest extends JUnitSuite { 21 | 22 | @Test 23 | public void testCreateWithActorSystem() { 24 | ActorSystem sys = ActorSystem.create("test"); 25 | ClientConnectionSettings settings = ClientConnectionSettings.create(sys); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/test/java/org/apache/pekko/http/javadsl/settings/ConnectionPoolSettingsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.settings; 15 | 16 | import org.apache.pekko.actor.ActorSystem; 17 | import org.junit.Test; 18 | import org.scalatestplus.junit.JUnitSuite; 19 | 20 | public class ConnectionPoolSettingsTest extends JUnitSuite { 21 | 22 | @Test 23 | public void testCreateWithActorSystem() { 24 | ActorSystem sys = ActorSystem.create("test"); 25 | ConnectionPoolSettings settings = ConnectionPoolSettings.create(sys); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/test/java/org/apache/pekko/http/javadsl/settings/ParserSettingsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.settings; 15 | 16 | import org.apache.pekko.actor.ActorSystem; 17 | import org.junit.Test; 18 | import org.scalatestplus.junit.JUnitSuite; 19 | 20 | public class ParserSettingsTest extends JUnitSuite { 21 | 22 | @Test 23 | public void testCreateWithActorSystem() { 24 | ActorSystem sys = ActorSystem.create("test"); 25 | ParserSettings settings = ParserSettings.create(sys); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/test/java/org/apache/pekko/http/javadsl/settings/ServerSettingsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.settings; 15 | 16 | import org.apache.pekko.actor.ActorSystem; 17 | import org.junit.Test; 18 | import org.scalatestplus.junit.JUnitSuite; 19 | 20 | public class ServerSettingsTest extends JUnitSuite { 21 | 22 | @Test 23 | public void testCreateWithActorSystem() { 24 | ActorSystem sys = ActorSystem.create("test"); 25 | ServerSettings settings = ServerSettings.create(sys); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /http-core/src/test/resources/keys/server.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-core/src/test/resources/keys/server.p12 -------------------------------------------------------------------------------- /http-core/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | pekko { 4 | loggers = ["org.apache.pekko.testkit.TestEventListener"] 5 | actor { 6 | default-dispatcher.throughput = 1 7 | } 8 | stream.materializer.debug.fuzzing-mode = off 9 | } 10 | -------------------------------------------------------------------------------- /http-scalafix/README.md: -------------------------------------------------------------------------------- 1 | The setup of the scalafix module roughly follows the example in https://github.com/scalacenter/scalafix.g8. 2 | 3 | ## Adding new rules 4 | 5 | * Add before/after test file in scalafix-test-input / scalafix-test-output 6 | * Add rule in scalafix-rules 7 | * run test in `http-scalafix-tests` 8 | 9 | ## Applying locally defined rules to docs examples 10 | 11 | * run `scalafixEnable` on the sbt shell (this will unfortunately require a complete rebuild afterwards) 12 | * run `set scalacOptions in ThisBuild += "-P:semanticdb:synthetics:on"` to allow access to synthetics 13 | * e.g. run `docs/scalafixAll MigrateToServerBuilder` 14 | 15 | *Note:* There's some weird stuff going on regarding cross-publishing. If running the rule fails with a weird error, try switching to Scala 2.12 first with `++2.12.11` (or 16 | whatever is now the current version). 17 | -------------------------------------------------------------------------------- /http-scalafix/scalafix-rules/src/main/resources/META-INF/services/scalafix.v1.Rule: -------------------------------------------------------------------------------- 1 | org.apache.pekko.http.fix.MigrateToServerBuilder 2 | -------------------------------------------------------------------------------- /http-scalafix/scalafix-tests/src/test/scala/org/apache/pekko/http/fix/RuleSuite.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2020-2021 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.fix 15 | 16 | import org.scalatest.FunSpecLike 17 | import scalafix.testkit.AbstractSemanticRuleSuite 18 | 19 | class RuleSuite extends AbstractSemanticRuleSuite with FunSpecLike { 20 | runAllTests() 21 | } 22 | -------------------------------------------------------------------------------- /http-testkit-munit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/munit/MunitRouteTest.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | package org.apache.pekko.http.scaladsl.testkit.munit 19 | 20 | import org.apache.pekko.http.scaladsl.testkit.RouteTest 21 | 22 | trait MunitRouteTest extends MunitTestFramework with RouteTest 23 | -------------------------------------------------------------------------------- /http-testkit/src/main/resources/reference.conf: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | pekko.http.testkit.marshalling.timeout = 1 s 4 | -------------------------------------------------------------------------------- /http-testkit/src/main/scala/org/apache/pekko/http/javadsl/testkit/DefaultHostInfo.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.testkit 15 | 16 | import org.apache.pekko.http.javadsl.model.headers.Host 17 | 18 | final case class DefaultHostInfo(private val host: Host, private val securedConnection: Boolean) { 19 | 20 | def getHost(): Host = host 21 | 22 | def isSecuredConnection(): Boolean = securedConnection 23 | 24 | } 25 | -------------------------------------------------------------------------------- /http-testkit/src/main/scala/org/apache/pekko/http/scaladsl/testkit/RouteTestTimeout.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.testkit 15 | 16 | import scala.concurrent.duration._ 17 | import org.apache.pekko 18 | import pekko.actor.ActorSystem 19 | import pekko.testkit._ 20 | 21 | case class RouteTestTimeout(duration: FiniteDuration) 22 | 23 | object RouteTestTimeout { 24 | implicit def default(implicit system: ActorSystem): RouteTestTimeout = RouteTestTimeout(1.second.dilated) 25 | } 26 | -------------------------------------------------------------------------------- /http-tests/src/main/java/org/apache/pekko/http/javadsl/server/examples/petstore/Pet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.server.examples.petstore; 15 | 16 | import com.fasterxml.jackson.annotation.JsonCreator; 17 | import com.fasterxml.jackson.annotation.JsonProperty; 18 | 19 | public class Pet { 20 | private final int id; 21 | private final String name; 22 | 23 | @JsonCreator 24 | public Pet(@JsonProperty("id") int id, @JsonProperty("name") String name) { 25 | this.id = id; 26 | this.name = name; 27 | } 28 | 29 | public int getId() { 30 | return id; 31 | } 32 | 33 | public String getName() { 34 | return name; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /http-tests/src/main/java/org/apache/pekko/http/javadsl/server/examples/petstore/PetStoreController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.server.examples.petstore; 15 | 16 | import org.apache.pekko.http.javadsl.model.StatusCodes; 17 | import static org.apache.pekko.http.javadsl.server.Directives.*; 18 | 19 | import org.apache.pekko.http.javadsl.server.Route; 20 | 21 | import java.util.Map; 22 | 23 | public class PetStoreController { 24 | private Map dataStore; 25 | 26 | public PetStoreController(Map dataStore) { 27 | this.dataStore = dataStore; 28 | } 29 | 30 | public Route deletePet(int petId) { 31 | dataStore.remove(petId); 32 | return complete(StatusCodes.OK); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /http-tests/src/main/resources/httpsDemoKeys/keys/server.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-tests/src/main/resources/httpsDemoKeys/keys/server.p12 -------------------------------------------------------------------------------- /http-tests/src/main/resources/web/calculator.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

Calculator

4 | 5 |

Add

6 |
7 | 8 | 9 | 10 |
11 | 12 |

Subtract

13 |
14 | 15 | 16 | 17 |
18 | 19 |

Multiply

20 | /multiply/42/23 21 | 22 | 23 | -------------------------------------------------------------------------------- /http-tests/src/multi-jvm/scala/org/apache/pekko/testkit/TestTags.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.testkit 15 | 16 | import org.scalatest.Tag 17 | 18 | object TimingTest extends Tag("timing") 19 | object LongRunningTest extends Tag("long-running") 20 | object PerformanceTest extends Tag("performance") 21 | -------------------------------------------------------------------------------- /http-tests/src/multi-jvm/scala/org/scalatest/extra/QuietReporter.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.scalatest.extra 15 | 16 | import org.scalatest.tools.StandardOutReporter 17 | import org.scalatest.events._ 18 | import java.lang.Boolean.getBoolean 19 | 20 | class QuietReporter(inColor: Boolean, withDurations: Boolean = false) 21 | extends StandardOutReporter(withDurations, inColor, false, true, false, false, false, false, false, false, 22 | presentJson = false) { 23 | 24 | def this() = this(!getBoolean("pekko.test.nocolor"), !getBoolean("pekko.test.nodurations")) 25 | 26 | override def apply(event: Event): Unit = event match { 27 | case _: RunStarting => () 28 | case _ => super.apply(event) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /http-tests/src/test/extra-libs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-tests/src/test/extra-libs.zip -------------------------------------------------------------------------------- /http-tests/src/test/extra-libs.zip.README: -------------------------------------------------------------------------------- 1 | # extra-libs.zip 2 | 3 | This zip file contains a jar file that is added to the testing classpath (via build.sbt). The jar file has a name with 4 | non-ascii characters (to test against filename encoding issues). It was wrapped into a zip file to avoid issues with 5 | tooling which cannot handle non-ascii characters in filenames (in this case, Scala Steward, but also other tools had 6 | problems with this file). 7 | 8 | ``` 9 | Archive: http-tests/src/test/extra-libs.zip 10 | Length Date Time Name 11 | --------- ---------- ----- ---- 12 | 488 2017-06-14 16:05 i have späces.jar 13 | --------- ------- 14 | 488 1 file 15 | 16 | Archive: i have späces.jar 17 | Length Date Time Name 18 | --------- ---------- ----- ---- 19 | 0 2015-07-02 15:11 META-INF/ 20 | 68 2015-07-02 15:11 META-INF/MANIFEST.MF 21 | 19 2015-07-02 15:11 test-resource.txt 22 | --------- ------- 23 | 87 3 files 24 | ``` 25 | -------------------------------------------------------------------------------- /http-tests/src/test/java/AllJavaTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | import org.apache.pekko.http.javadsl.server.HandlerBindingTest; 15 | import docs.http.javadsl.server.HandlerExampleDocTest; 16 | import org.junit.runner.RunWith; 17 | import org.junit.runners.Suite; 18 | 19 | @RunWith(Suite.class) 20 | @Suite.SuiteClasses({HandlerBindingTest.class, HandlerExampleDocTest.class}) 21 | public class AllJavaTests {} 22 | -------------------------------------------------------------------------------- /http-tests/src/test/java/org/apache/pekko/http/javadsl/settings/RoutingSettingsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.settings; 15 | 16 | import org.apache.pekko.actor.ActorSystem; 17 | import com.typesafe.config.Config; 18 | import com.typesafe.config.ConfigFactory; 19 | import org.junit.Test; 20 | import org.scalatestplus.junit.JUnitSuite; 21 | 22 | public class RoutingSettingsTest extends JUnitSuite { 23 | 24 | @Test 25 | public void testCreateWithActorSystem() { 26 | Config config = ConfigFactory.load().resolve(); 27 | ActorSystem sys = ActorSystem.create("test", config); 28 | RoutingSettings settings = RoutingSettings.create(sys); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /http-tests/src/test/resources/application.conf: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | 3 | pekko { 4 | loggers = ["org.apache.pekko.testkit.TestEventListener"] 5 | actor { 6 | serialize-creators = off 7 | serialize-messages = off 8 | default-dispatcher.throughput = 1 9 | } 10 | stream.materializer.debug.fuzzing-mode = on 11 | 12 | # silence some annoying warnings 13 | stream.secret-test-fuzzing-warning-disable = 42 14 | actor.warn-about-java-serializer-usage = false 15 | } 16 | -------------------------------------------------------------------------------- /http-tests/src/test/resources/sample.html: -------------------------------------------------------------------------------- 1 |

Lorem ipsum!

-------------------------------------------------------------------------------- /http-tests/src/test/resources/sample.xyz: -------------------------------------------------------------------------------- 1 | XyZ -------------------------------------------------------------------------------- /http-tests/src/test/resources/someDir/fileA.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /http-tests/src/test/resources/someDir/fileB.xml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-tests/src/test/resources/someDir/fileB.xml -------------------------------------------------------------------------------- /http-tests/src/test/resources/someDir/sub/file.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-tests/src/test/resources/someDir/sub/file.html -------------------------------------------------------------------------------- /http-tests/src/test/resources/subDirectory/empty.pdf: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /http-tests/src/test/resources/subDirectory/fileA.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/pekko-http/92314d6029b26adebdc65b62c2083603b851ab47/http-tests/src/test/resources/subDirectory/fileA.txt -------------------------------------------------------------------------------- /http-tests/src/test/resources/sübdir/sample späce.PDF: -------------------------------------------------------------------------------- 1 | This is PDF -------------------------------------------------------------------------------- /http-tests/src/test/scala-2.13+/org/apache/pekko/http/scaladsl/server/util/VarArgsFunction1.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server.util 15 | 16 | // in 2.13 (T*) => U is not a valid type any more, this works on 2.12+ as a drop in replacement 17 | trait VarArgsFunction1[-T, +U] { 18 | def apply(alternatives: T*): U 19 | } 20 | -------------------------------------------------------------------------------- /http-tests/src/test/scala-2.13-/main/org/apache/pekko/http/scaladsl/server/util/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server 15 | 16 | package object util { 17 | type VarArgsFunction1[-T, +U] = (T*) => U 18 | } 19 | -------------------------------------------------------------------------------- /http-tests/src/test/scala-2.13-/src/main/org/apache/pekko/http/ccompat/ImplicitUtils.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | object ImplicitUtils 17 | -------------------------------------------------------------------------------- /http-tests/src/test/scala-2.13/src/main/org/apache/pekko/http/ccompat/ImplicitUtils.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | object ImplicitUtils 17 | -------------------------------------------------------------------------------- /http-tests/src/test/scala-3/src/main/org/apache/pekko/http/ccompat/ImplicitUtils.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | import scala.collection.immutable.StringOps 17 | 18 | object ImplicitUtils { 19 | // Scala 3 resolves implicit conversions differently than Scala 2, 20 | // in some instances overriding StringOps operations, like *. 21 | implicit class Scala3StringOpsFix(string: String) { 22 | def *(amount: Int): String = StringOps(string) * amount 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /http-tests/src/test/scala/org/apache/pekko/http/scaladsl/coding/NoCodingSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.coding 15 | 16 | import java.io.{ InputStream, OutputStream } 17 | 18 | class NoCodingSpec extends CoderSpec { 19 | protected def Coder: Coder = Coders.NoCoding 20 | 21 | override protected def corruptInputCheck = false 22 | 23 | protected def newEncodedOutputStream(underlying: OutputStream): OutputStream = underlying 24 | protected def newDecodedInputStream(underlying: InputStream): InputStream = underlying 25 | } 26 | -------------------------------------------------------------------------------- /http-tests/src/test/scala/org/apache/pekko/http/scaladsl/settings/RoutingSettingsEqualitySpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.settings 15 | 16 | import com.typesafe.config.ConfigFactory 17 | import org.scalatest.matchers.should.Matchers 18 | import org.scalatest.wordspec.AnyWordSpec 19 | 20 | class RoutingSettingsEqualitySpec extends AnyWordSpec with Matchers { 21 | 22 | val config = ConfigFactory.load.resolve 23 | 24 | "equality" should { 25 | 26 | "hold for RoutingSettings" in { 27 | val s1 = RoutingSettings(config) 28 | val s2 = RoutingSettings(config) 29 | 30 | s1 shouldBe s2 31 | s1.toString should startWith("RoutingSettings(") 32 | } 33 | 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /http-tests/src/test/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/BaseUnmarshallingSpec.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http 15 | package scaladsl 16 | package unmarshalling 17 | package sse 18 | 19 | import org.apache.pekko 20 | import pekko.actor.ActorSystem 21 | import org.scalatest.{ BeforeAndAfterAll, Suite } 22 | import scala.concurrent.Await 23 | import scala.concurrent.duration.DurationInt 24 | 25 | trait BaseUnmarshallingSpec extends BeforeAndAfterAll { this: Suite => 26 | 27 | protected implicit val system: ActorSystem = 28 | ActorSystem() 29 | 30 | override protected def afterAll() = { 31 | Await.ready(system.terminate(), 42.seconds) 32 | super.afterAll() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /http/src/main/boilerplate/org/apache/pekko/http/scaladsl/server/util/ApplyConverterInstances.scala.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2020 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server.util 15 | 16 | import org.apache.pekko.http.scaladsl.server.Route 17 | 18 | private[util] abstract class ApplyConverterInstances { 19 | [#implicit def hac1[[#T1#]]: ApplyConverter[Tuple1[[#T1#]]] { type In = ([#T1#]) => Route } = new ApplyConverter[Tuple1[[#T1#]]] { 20 | type In = ([#T1#]) => Route 21 | def apply(fn: In): (Tuple1[[#T1#]]) => Route = { 22 | case Tuple1([#t1#]) => fn([#t1#]) 23 | } 24 | }# 25 | ] 26 | } -------------------------------------------------------------------------------- /http/src/main/boilerplate/org/apache/pekko/http/scaladsl/server/util/ConstructFromTupleInstances.scala.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2020 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server.util 15 | 16 | private[util] abstract class ConstructFromTupleInstances { 17 | [#implicit def instance1[[#T1#], R](construct: ([#T1#]) => R): ConstructFromTuple[Tuple1[[#T1#]], R] = 18 | new ConstructFromTuple[Tuple1[[#T1#]], R] { 19 | def apply(tup: Tuple1[[#T1#]]): R = construct([#tup._1#]) 20 | }# 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /http/src/main/java/org/apache/pekko/http/javadsl/common/RegexConverters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.javadsl.common; 15 | 16 | import java.util.regex.Pattern; 17 | 18 | import scala.collection.immutable.Seq; 19 | import scala.collection.immutable.VectorBuilder; 20 | import scala.util.matching.Regex; 21 | 22 | public final class RegexConverters { 23 | private static final Seq empty = new VectorBuilder().result(); 24 | 25 | /** Converts the given Java Pattern into a scala Regex, without recompiling it. */ 26 | public static Regex toScala(Pattern p) { 27 | return new Regex(p, empty); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Coder.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.coding 15 | 16 | /** Marker trait for A combined Encoder and Decoder */ 17 | trait Coder extends Encoder with Decoder 18 | -------------------------------------------------------------------------------- /http/src/main/scala/org/apache/pekko/http/scaladsl/marshalling/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl 15 | 16 | import scala.collection.immutable 17 | import org.apache.pekko 18 | import pekko.http.scaladsl.model._ 19 | import pekko.util.ByteString 20 | 21 | package object marshalling { 22 | // #marshaller-aliases 23 | type ToEntityMarshaller[T] = Marshaller[T, MessageEntity] 24 | type ToByteStringMarshaller[T] = Marshaller[T, ByteString] 25 | type ToHeadersAndEntityMarshaller[T] = Marshaller[T, (immutable.Seq[HttpHeader], MessageEntity)] 26 | type ToResponseMarshaller[T] = Marshaller[T, HttpResponse] 27 | type ToRequestMarshaller[T] = Marshaller[T, HttpRequest] 28 | // #marshaller-aliases 29 | } 30 | -------------------------------------------------------------------------------- /http/src/main/scala/org/apache/pekko/http/scaladsl/server/package.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl 15 | 16 | import scala.concurrent.Future 17 | 18 | package object server { 19 | 20 | type Route = RequestContext => Future[RouteResult] 21 | 22 | type RouteGenerator[T] = T => Route 23 | type Directive0 = Directive[Unit] 24 | type Directive1[T] = Directive[Tuple1[T]] 25 | type PathMatcher0 = PathMatcher[Unit] 26 | type PathMatcher1[T] = PathMatcher[Tuple1[T]] 27 | 28 | def FIXME = throw new RuntimeException("Not yet implemented") 29 | } 30 | -------------------------------------------------------------------------------- /http/src/main/scala/org/apache/pekko/http/scaladsl/server/util/ApplyConverter.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server.util 15 | 16 | import org.apache.pekko.http.scaladsl.server._ 17 | 18 | /** 19 | * ApplyConverter allows generic conversion of functions of type `(T1, T2, ...) => Route` to 20 | * `(TupleX(T1, T2, ...)) => Route`. 21 | */ 22 | abstract class ApplyConverter[L] { 23 | type In 24 | def apply(f: In): L => Route 25 | } 26 | 27 | object ApplyConverter extends ApplyConverterInstances 28 | -------------------------------------------------------------------------------- /http/src/main/scala/org/apache/pekko/http/scaladsl/server/util/ConstructFromTuple.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2009-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.scaladsl.server.util 15 | 16 | /** 17 | * Constructor for instances of type `R` which can be created from a tuple of type `T`. 18 | */ 19 | @FunctionalInterface 20 | trait ConstructFromTuple[T, R] extends (T => R) 21 | 22 | object ConstructFromTuple extends ConstructFromTupleInstances 23 | -------------------------------------------------------------------------------- /legal/CorsNotice.txt: -------------------------------------------------------------------------------- 1 | Apache Pekko HTTP 2 | Copyright 2022-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | 7 | This product contains significant parts that were originally based on software from Lightbend (Akka ). 8 | Copyright (C) 2009-2022 Lightbend Inc. 9 | 10 | Apache Pekko-HTTP is derived from Akka-HTTP 10.2.x, the last version that was distributed under the 11 | Apache License, Version 2.0 License. 12 | 13 | --------------- 14 | 15 | pekko-http-cors contains code that was donated by Lomig Mégard to the Apache Software Foundation 16 | via a Software Grant Agreement 17 | See . 18 | -------------------------------------------------------------------------------- /legal/PekkoNotice.txt: -------------------------------------------------------------------------------- 1 | Apache Pekko HTTP 2 | Copyright 2022-2025 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (https://www.apache.org/). 6 | 7 | This product contains significant parts that were originally based on software from Lightbend (Akka ). 8 | Copyright (C) 2009-2022 Lightbend Inc. 9 | 10 | Apache Pekko-HTTP is derived from Akka-HTTP 10.2.x, the last version that was distributed under the 11 | Apache License, Version 2.0 License. 12 | -------------------------------------------------------------------------------- /parsing/src/main/scala-3/org/apache/pekko/http/ccompat/pre213macro.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | import scala.annotation.StaticAnnotation 17 | 18 | // FIXME: need to implement or we will resurrect some ugly things (or remove 2.12 support) 19 | class pre213 extends StaticAnnotation 20 | -------------------------------------------------------------------------------- /parsing/src/main/scala-3/org/apache/pekko/http/ccompat/since213macro.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2019-2022 Lightbend Inc. 12 | */ 13 | 14 | package org.apache.pekko.http.ccompat 15 | 16 | import scala.annotation.StaticAnnotation 17 | 18 | class since213 extends StaticAnnotation 19 | -------------------------------------------------------------------------------- /project/GitHub.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2017-2020 Lightbend Inc. 12 | */ 13 | 14 | object GitHub { 15 | 16 | def envTokenOrThrow: String = 17 | System.getenv("PR_VALIDATOR_GH_TOKEN") 18 | .ensuring(_ != null, "No PR_VALIDATOR_GH_TOKEN env var provided, unable to reach github!") 19 | 20 | def url(v: String, isSnapshot: Boolean): String = { 21 | val branch = if (isSnapshot) "main" else "v" + v 22 | "https://github.com/apache/pekko-http/tree/" + branch 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /project/NoScala3.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | import sbt.{ Def, _ } 11 | import Keys._ 12 | 13 | object NoScala3 extends AutoPlugin { 14 | override def projectSettings: Seq[Def.Setting[_]] = Seq( 15 | crossScalaVersions := crossScalaVersions.value.filterNot(_.startsWith("3."))) 16 | } 17 | -------------------------------------------------------------------------------- /project/SbtInternalAccess.scala: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * license agreements; and to You under the Apache License, version 2.0: 4 | * 5 | * https://www.apache.org/licenses/LICENSE-2.0 6 | * 7 | * This file is part of the Apache Pekko project, which was derived from Akka. 8 | */ 9 | 10 | /* 11 | * Copyright (C) 2017-2020 Lightbend Inc. 12 | */ 13 | 14 | package sbt { 15 | package object access { 16 | type Aggregation = sbt.internal.Aggregation 17 | val Aggregation = sbt.internal.Aggregation 18 | 19 | private val showRunMethod = { 20 | val method = Class.forName("sbt.internal.Aggregation$").getDeclaredMethods.find(_.getName == "showRun").get 21 | method.setAccessible(true) 22 | method 23 | } 24 | def AggregationShowRun[T](complete: sbt.internal.Aggregation.Complete[T], 25 | show: sbt.internal.Aggregation.ShowConfig)( 26 | implicit display: Show[ScopedKey[_]]): Unit = showRunMethod.invoke(Aggregation, complete, show, display) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=1.11.2 2 | --------------------------------------------------------------------------------