public abstract class HeaderDirectives extends FutureDirectives
Constructor and Description |
---|
HeaderDirectives() |
Modifier and Type | Method and Description |
---|---|
Route |
checkSameOrigin(HttpOriginRange allowed,
java.util.function.Supplier<Route> inner)
Checks that request comes from the same origin.
|
<T> RouteAdapter |
headerValue(java.util.function.Function<HttpHeader,java.util.Optional<T>> f,
java.util.function.Function<T,Route> inner)
Extracts an HTTP header value using the given function.
|
RouteAdapter |
headerValueByName(java.lang.String headerName,
java.util.function.Function<java.lang.String,Route> inner)
Extracts the value of the first HTTP request header with the given name.
|
<T extends HttpHeader> |
headerValueByType(java.lang.Class<T> t,
java.util.function.Function<T,Route> inner)
Extracts the first HTTP request header of the given type.
|
<T> RouteAdapter |
headerValuePF(scala.PartialFunction<HttpHeader,T> pf,
java.util.function.Function<T,Route> inner)
Extracts an HTTP header value using the given partial function.
|
<T> RouteAdapter |
optionalHeaderValue(java.util.function.Function<HttpHeader,java.util.Optional<T>> f,
java.util.function.Function<java.util.Optional<T>,Route> inner)
Extracts an optional HTTP header value using the given function.
|
RouteAdapter |
optionalHeaderValueByName(java.lang.String headerName,
java.util.function.Function<java.util.Optional<java.lang.String>,Route> inner)
Extracts the value of the optional HTTP request header with the given name.
|
<T extends HttpHeader> |
optionalHeaderValueByType(java.lang.Class<T> t,
java.util.function.Function<java.util.Optional<T>,Route> inner)
FIXME: WARNING: Custom headers don't work yet with this directive!
|
<T> RouteAdapter |
optionalHeaderValuePF(scala.PartialFunction<HttpHeader,T> pf,
java.util.function.Function<java.util.Optional<T>,Route> inner)
Extracts an optional HTTP header value using the given partial function.
|
completeOrRecoverWith, onComplete, onComplete, onCompleteWithBreaker, onSuccess, onSuccess
formField, formField, formFieldList, formFieldList, formFieldList, formFieldMap, formFieldMultiMap, formFieldOptional, formFieldOptional
fileUpload, fileUploadAll, storeUploadedFile, storeUploadedFiles
defaultContentTypeResolver, defaultDirectoryRenderer, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectories, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromBrowseableDirectory, getFromDirectory, getFromDirectory, getFromFile, getFromFile, getFromFile, getFromFile, getFromFile, getFromResource, getFromResource, getFromResource, getFromResource, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, getFromResourceDirectory, listDirectoryContents, listDirectoryContents, listDirectoryContents, listDirectoryContents
handleExceptions, handleRejections
logRequest, logRequest, logRequest, logRequestResult, logRequestResultOptional, logResult, logResult, logResult
cookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, deleteCookie, optionalCookie, setCookie, setCookie
decodeRequest, decodeRequestWith, decodeRequestWith, encodeResponse, encodeResponseWith, requestEncodedWith, responseEncodingAccepted, withPrecompressedMediaTypeSupport
conditional, conditional, conditional, conditional
cancelRejection, cancelRejections, cancelRejections, extract, extractActorSystem, extractDataBytes, extractEntity, extractExecutionContext, extractLog, extractMatchedPath, extractMaterializer, extractParserSettings, extractRequest, extractRequestContext, extractRequestEntity, extractSettings, extractStrictEntity, extractStrictEntity, extractUnmatchedPath, extractUri, mapInnerRoute, mapRejections, mapRequest, mapRequestContext, mapResponse, mapResponseEntity, mapResponseHeaders, mapRouteResult, mapRouteResultFuture, mapRouteResultPF, mapRouteResultWith, mapRouteResultWithPF, mapSettings, mapUnmatchedPath, pass, provide, recoverRejections, recoverRejectionsWith, toStrictEntity, toStrictEntity, withExecutionContext, withLog, withMaterializer, withSettings
public Route checkSameOrigin(HttpOriginRange allowed, java.util.function.Supplier<Route> inner)
Origin
header value and verifies that
allowed range contains the obtained value. In the case of absent of the Origin
header rejects
with MissingHeaderRejection
. If the origin value is not in the allowed range
rejects with an InvalidOriginRejection
and StatusCodes.FORBIDDEN
status.
allowed
- (undocumented)inner
- (undocumented)public <T> RouteAdapter headerValue(java.util.function.Function<HttpHeader,java.util.Optional<T>> f, java.util.function.Function<T,Route> inner)
pekko.http.javadsl.server.MalformedHeaderRejection
.f
- (undocumented)inner
- (undocumented)public RouteAdapter headerValueByName(java.lang.String headerName, java.util.function.Function<java.lang.String,Route> inner)
pekko.http.javadsl.server.MissingHeaderRejection
.headerName
- (undocumented)inner
- (undocumented)public <T extends HttpHeader> RouteAdapter headerValueByType(java.lang.Class<T> t, java.util.function.Function<T,Route> inner)
pekko.http.javadsl.server.MissingHeaderRejection
.t
- (undocumented)inner
- (undocumented)public <T> RouteAdapter headerValuePF(scala.PartialFunction<HttpHeader,T> pf, java.util.function.Function<T,Route> inner)
pf
- (undocumented)inner
- (undocumented)public <T> RouteAdapter optionalHeaderValue(java.util.function.Function<HttpHeader,java.util.Optional<T>> f, java.util.function.Function<java.util.Optional<T>,Route> inner)
pekko.http.javadsl.server.MalformedHeaderRejection
.f
- (undocumented)inner
- (undocumented)public RouteAdapter optionalHeaderValueByName(java.lang.String headerName, java.util.function.Function<java.util.Optional<java.lang.String>,Route> inner)
headerName
- (undocumented)inner
- (undocumented)public <T extends HttpHeader> RouteAdapter optionalHeaderValueByType(java.lang.Class<T> t, java.util.function.Function<java.util.Optional<T>,Route> inner)
Extract the header value of the optional HTTP request header with the given type.
t
- (undocumented)inner
- (undocumented)public <T> RouteAdapter optionalHeaderValuePF(scala.PartialFunction<HttpHeader,T> pf, java.util.function.Function<java.util.Optional<T>,Route> inner)
pekko.http.javadsl.server.MalformedHeaderRejection
.pf
- (undocumented)inner
- (undocumented)