Language: Java
Label: safe
CWE: NVD-CWE-noinfo \u2014 

Code:
    private static URI uri(ServiceRequestContext ctx, HttpRequest req) {
        final String scheme = req.scheme();
        final String authority = req.authority();
        // Server side Armeria HTTP request always has the scheme and authority.
        assert scheme != null;
        assert authority != null;
        final RequestTarget requestTarget = ctx.routingContext().requestTarget();
        String path = requestTarget.maybePathWithMatrixVariables();
        if (requestTarget.query() != null) {
            path = path + '?' + requestTarget.query();
        }
        return URI.create(scheme + "://" + authority + path);
    }