Skip to content

Commit

Permalink
Move away from getUri.toString in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
yawkat committed Dec 10, 2022
1 parent 686de0f commit 4a040af
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private boolean isWebSocketUpgrade(@NonNull NettyHttpRequest<?> request) {
protected final void channelRead0(ChannelHandlerContext ctx, NettyHttpRequest<?> msg) {
ServerRequestContext.set(msg);

Optional<UriRouteMatch<Object, Object>> optionalRoute = router.find(HttpMethod.GET, msg.getUri().toString(), msg)
Optional<UriRouteMatch<Object, Object>> optionalRoute = router.find(HttpMethod.GET, msg.getPath(), msg)
.filter(rm -> rm.isAnnotationPresent(OnMessage.class) || rm.isAnnotationPresent(OnOpen.class))
.findFirst();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ final ExecutionFlow<MutableHttpResponse<?>> onRouteMiss(HttpRequest<?> httpReque

// if there is no route present try to locate a route that matches a different HTTP method
final List<UriRouteMatch<Object, Object>> anyMatchingRoutes = routeExecutor.router
.findAny(httpRequest.getUri().toString(), httpRequest).toList();
.findAny(httpRequest.getPath(), httpRequest).toList();
final Collection<MediaType> acceptedTypes = httpRequest.accept();
final boolean hasAcceptHeader = CollectionUtils.isNotEmpty(acceptedTypes);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ UriRouteMatch<Object, Object> findRouteMatch(HttpRequest<?> httpRequest) {

List<UriRouteMatch<Object, Object>> uriRoutes = router.findAllClosest(httpRequest);
if (uriRoutes.size() > 1) {
throw new DuplicateRouteException(httpRequest.getUri().getPath(), uriRoutes);
throw new DuplicateRouteException(httpRequest.getPath(), uriRoutes);
} else if (uriRoutes.size() == 1) {
routeMatch = uriRoutes.get(0);
}
Expand Down

0 comments on commit 4a040af

Please sign in to comment.