public static URI getUri(Request jettyRequest) {
        try {
            String scheme = jettyRequest.getHttpURI().getScheme();
            String host = Request.getServerName(jettyRequest);
            if (host == null || host.isBlank()) {
                // Some clients may violate the HTTP/2 specification and use a blank :authority header.
                // To keep compatibility with the previous Jetty 11 integration, fallback to a different value, the local address in this case.
                // TODO Remove this fallback in Vespa 9
                var localAddr = Request.getLocalAddr(jettyRequest);
                log.log(Level.FINE, () -> "Warning: missing Host/:authority header in request. Falling back to " + localAddr);
                host = localAddr;
            }
            int port = getConnectorLocalPort(jettyRequest);
            String path = jettyRequest.getHttpURI().getPath();
            String query = jettyRequest.getHttpURI().getQuery();

            URI uri = URI.create(scheme + "://" +
                                 host + ":" + port +
                                 (path != null ? path : "") +
                                 (query != null ? "?" + query : ""));

            validateSchemeHostPort(scheme, host, port, uri);
            return uri;
        }
        catch (IllegalArgumentException e) {
            throw createBadQueryException(e);
        }
    }
@author Simon Thoresen Hult
@author bjorncs
container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/HttpRequestFactory.java