Class BeforeFilterFunctions
java.lang.Object
org.springframework.cloud.gateway.server.mvc.filter.BeforeFilterFunctions
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault CircuitBreaker Fallback Execution Exception Message header name.static final StringDefault CircuitBreaker Fallback Execution Exception Type header name.static final StringDefault CircuitBreaker Root Cause Execution Exception Message header name.static final StringDefault CircuitBreaker Root Cause Execution Exception Type header name. -
Method Summary
Modifier and TypeMethodDescriptionstatic Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeader(String name, String... values) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeadersIfNotPresent(String... values) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeadersIfNotPresent(List<KeyValues.KeyValue> keyValues) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestParameter(String name, String... values) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> fallbackHeaders(Consumer<BeforeFilterFunctions.FallbackHeadersConfig> configConsumer) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> mapRequestHeader(String fromHeader, String toHeader) static <T,R> Function<org.springframework.web.servlet.function.ServerRequest, org.springframework.web.servlet.function.ServerRequest> modifyRequestBody(Class<T> inClass, Class<R> outClass, String newContentType, BodyFilterFunctions.RewriteFunction<T, R> rewriteFunction) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> prefixPath(String prefix) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> removeRequestHeader(String name) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> removeRequestParameter(String name) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(String maxSize) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(String maxSize, String errorHeaderName) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(org.springframework.util.unit.DataSize maxSize) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(org.springframework.util.unit.DataSize maxSize, String errorHeaderName) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestSize(String maxSize) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestSize(org.springframework.util.unit.DataSize maxSize) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> rewritePath(String regexp, String replacement) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> rewriteRequestParameter(String name, String replacement) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> setRequestHeader(String name, String value) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> setRequestHostHeader(String host) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> Returns a filter function that strips the servlet context-path from the request URI.static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripPrefix(int parts) static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest>
-
Field Details
-
CB_EXECUTION_EXCEPTION_TYPE
Default CircuitBreaker Fallback Execution Exception Type header name.- See Also:
-
CB_EXECUTION_EXCEPTION_MESSAGE
Default CircuitBreaker Fallback Execution Exception Message header name.- See Also:
-
CB_ROOT_CAUSE_EXCEPTION_TYPE
Default CircuitBreaker Root Cause Execution Exception Type header name.- See Also:
-
CB_ROOT_CAUSE_EXCEPTION_MESSAGE
Default CircuitBreaker Root Cause Execution Exception Message header name.- See Also:
-
-
Method Details
-
adaptCachedBody
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> adaptCachedBody() -
addRequestHeader
-
addRequestHeadersIfNotPresent
-
addRequestHeadersIfNotPresent
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> addRequestHeadersIfNotPresent(List<KeyValues.KeyValue> keyValues) -
addRequestParameter
-
fallbackHeaders
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> fallbackHeaders() -
fallbackHeaders
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> fallbackHeaders(Consumer<BeforeFilterFunctions.FallbackHeadersConfig> configConsumer) -
mapRequestHeader
-
modifyRequestBody
public static <T,R> Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> modifyRequestBody(Class<T> inClass, Class<R> outClass, String newContentType, BodyFilterFunctions.RewriteFunction<T, R> rewriteFunction) -
prefixPath
-
preserveHostHeader
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> preserveHostHeader() -
removeRequestHeader
-
removeRequestParameter
-
requestHeaderSize
-
requestHeaderSize
-
requestHeaderSize
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestHeaderSize(org.springframework.util.unit.DataSize maxSize) -
requestHeaderSize
-
requestHeaderToRequestUri
-
requestSize
-
requestSize
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> requestSize(org.springframework.util.unit.DataSize maxSize) -
rewritePath
-
rewriteRequestParameter
-
routeId
-
setPath
-
setRequestHeader
-
setRequestHostHeader
-
stripContextPath
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripContextPath()Returns a filter function that strips the servlet context-path from the request URI. Users should add this filter before path-manipulating filters (StripPrefix, RewritePath, PrefixPath) when usingserver.servlet.context-path.- Returns:
- a function that strips the context-path from the request URI
-
stripPrefix
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripPrefix() -
stripPrefix
public static Function<org.springframework.web.servlet.function.ServerRequest,org.springframework.web.servlet.function.ServerRequest> stripPrefix(int parts) -
uri
-
uri
-