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

Code:
    protected AbstractRequestContextBuilder(boolean server, RpcRequest rpcReq, URI uri) {
        this.server = server;
        req = null;
        this.rpcReq = requireNonNull(rpcReq, "rpcReq");
        method = HttpMethod.POST;

        requireNonNull(uri, "uri");
        authority = firstNonNull(uri.getRawAuthority(), FALLBACK_AUTHORITY);
        sessionProtocol = getSessionProtocol(uri);

        if (server) {
            String path = uri.getRawPath();
            final String query = uri.getRawQuery();
            if (query != null) {
                path += '?' + query;
            }
            final RequestTarget reqTarget = RequestTarget.forServer(path);
            if (reqTarget == null) {
                throw new IllegalArgumentException("invalid uri: " + uri);
            }
            this.reqTarget = reqTarget;
        } else {
            reqTarget = DefaultRequestTarget.createWithoutValidation(
                    RequestTargetForm.ORIGIN, null, null,
                    uri.getRawPath(), uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment());
        }
    }