Skip to content

Commit

Permalink
GH-2202 Automatically prefix routes with slash if missing (Resolve #2202
Browse files Browse the repository at this point in the history
)
  • Loading branch information
dzikoysk committed Sep 7, 2024
1 parent 139cda6 commit d95c298
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ internal class RouteAdd(private val accessTokenFacade: AccessTokenFacade) : Repo
return
}

if (!route.startsWith("/")) {
route = "/$route"
context.append("Provided route has been prefixed with /")
}

mappedPermissions.forEach { accessTokenFacade.addRoute(token.identifier, Route(route, it)) }
context.append("Route $route has been added to token ${token.name}")
}
Expand Down

0 comments on commit d95c298

Please sign in to comment.