spring-framework
5.3.39

# pathExtension

fun pathExtension(extension: String, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard
fun pathExtension(predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<out ServerResponse>)
Content copied to clipboard

Route to the given handler function if the given pathExtension predicate applies.

## See also

org.springframework.web.reactive.function.server.RouterFunctions
fun pathExtension(extension: String): RequestPredicate
Content copied to clipboard

Return a RequestPredicate that matches if the request's path has the given extension.

#### Return

a predicate that matches if the request's path has the given file extension

## Parameters

extension

the path extension to match against, ignoring case

fun pathExtension(predicate: (String) -> Boolean): RequestPredicate
Content copied to clipboard

Return a RequestPredicate that matches if the request's path matches the given predicate.

## See also

org.springframework.web.reactive.function.server.RequestPredicates