Skip to content

Commit

Permalink
Ran spotless on the project
Browse files Browse the repository at this point in the history
  • Loading branch information
MormonJesus69420 committed Jul 18, 2024
1 parent 61e6edf commit e4fa18e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ import reactor.core.publisher.Mono

@Component
class TrailingSlashRedirectFilter : WebFilter {
override fun filter(exchange: ServerWebExchange, chain: WebFilterChain): Mono<Void> {
override fun filter(
exchange: ServerWebExchange,
chain: WebFilterChain
): Mono<Void> {
val request = exchange.request
val path = request.path.value()

if (path.endsWith("/")) {
return chain.filter(exchange.mutate().request(
request.mutate().path(
path.removeSuffix("/"))
.build())
.build())
return chain.filter(
exchange.mutate().request(
request.mutate().path(
path.removeSuffix("/")
).build()
).build()
)
}

return chain.filter(exchange)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping(path = ["", "/v1"])
@RequestMapping(path = ["", "/v1"])
@Tag(name = "Product Controller", description = "API for managing products in Hermes WLS")
class ProductController(val productService: ProductService) {
@Operation(
Expand Down

0 comments on commit e4fa18e

Please sign in to comment.