public Routed<ServiceConfig> findServiceConfig(RoutingContext routingCtx, boolean useFallbackService) {
        final Routed<ServiceConfig> routed = router.find(requireNonNull(routingCtx, "routingCtx"));
        switch (routed.routingResultType()) {
            case MATCHED:
                maybeSetRoutingResult(routingCtx, routed);
                return routed;
            case NOT_MATCHED:
                if (routingCtx.method() == HttpMethod.HEAD) {
                    return findServiceConfig(routingCtx.withMethod(HttpMethod.GET), useFallbackService);
                }

                if (!useFallbackService) {
                    maybeSetRoutingResult(routingCtx, routed);
                    return routed;
                }
                break;
            case CORS_PREFLIGHT:
                assert routingCtx.status() == RoutingStatus.CORS_PREFLIGHT;
                if (routed.value().handlesCorsPreflight()) {
                    maybeSetRoutingResult(routingCtx, routed);
                    // CorsService will handle the preflight request
                    // even if the service does not handle an OPTIONS method.
                    return routed;
                } else {
                    // `handlesCorsPreflight()` is false if `CorsService` is set as a route decorator.
                    // However, this is not a problem because the CorsService is chosen and applied by
                    // `InitialDispatcherService` regardless of the target service.
                }
                break;
            default:
                // Never reaches here.
                throw new Error();
        }

        // Note that we did not implement this fallback mechanism inside a Router implementation like
        // CompositeRouter because we wanted to avoid caching non-existent mappings.
        final Routed<ServiceConfig> fallbackRoute =
                Routed.of(fallbackServiceConfig.route(),
                          RoutingResult.builder()
                                       .path(routingCtx.path())
                                       .query(routingCtx.query())
                                       .build(),
                          fallbackServiceConfig);
        maybeSetRoutingResult(routingCtx, fallbackRoute);
        return fallbackRoute;
    }
Finds the {@link HttpService} whose {@link Router} matches the {@link RoutingContext}.

@param routingCtx a context to find the {@link HttpService}.
@param useFallbackService whether to use the fallback {@link HttpService} when there is no match.
                          If {@code true}, the returned {@link Routed} will always be present.

@return the {@link ServiceConfig} wrapped by a {@link Routed} if there's a match.
        The fallback {@link ServiceConfig} wrapped by {@link Routed} if there's no match and
        {@code useFallbackService} is {@code true}.
        {@link Routed#empty()} if there's no match and {@code useFallbackService} is {@code false}.
core/src/main/java/com/linecorp/armeria/server/VirtualHost.java