Skip to content

Commit

Permalink
Restrict search endpoints to the empty path
Browse files Browse the repository at this point in the history
Otherwise sub-paths would also be matched, which could lead to
accidentally using invalid routes.
  • Loading branch information
eikek committed Feb 28, 2024
1 parent 6302968 commit d2cdce3
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ final class SearchRoutes[F[_]: Async](api: SearchApi[F])

private val searchEndpointGet: PublicEndpoint[QueryInput, String, SearchResult, Any] =
endpoint.get
.in("")
.in(Params.queryInput)
.errorOut(borerJsonBody[String])
.out(Params.searchResult)
.description(SearchQueryManual.markdown)

private val searchEndpointPost: PublicEndpoint[QueryInput, String, SearchResult, Any] =
endpoint.post
.in("")
.errorOut(borerJsonBody[String])
.in(
borerJsonBody[QueryInput]
Expand Down

0 comments on commit d2cdce3

Please sign in to comment.