spring-framework / org.springframework.web.reactive.function.server / RouterFunctionDsl / pathExtension

pathExtension

fun pathExtension(extension: String, f: (ServerRequest) -> Mono<out ServerResponse>): Unit
fun pathExtension(predicate: (String) -> Boolean, f: (ServerRequest) -> Mono<out ServerResponse>): Unit

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

See Also

RouterFunctions.route

fun pathExtension(extension: String): RequestPredicate

Return a {@code RequestPredicate} that matches if the request's path has the given extension.

Parameters

extension - the path extension to match against, ignoring case

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

fun pathExtension(predicate: (String) -> Boolean): RequestPredicate

Return a {@code RequestPredicate} that matches if the request's path matches the given predicate.

See Also

RequestPredicates.pathExtension