static URI normalizeSyntax(final URI uri) throws URISyntaxException {
        if (uri.isOpaque() || uri.getAuthority() == null) {
            // opaque and file: URIs
            return uri;
        }
        final URIBuilder builder = new URIBuilder(uri);
        final String scheme = builder.getScheme();
        if (scheme == null) {
            builder.setScheme(URIScheme.HTTP.id);
        } else {
            builder.setScheme(TextUtils.toLowerCase(scheme));
        }
        final String host = builder.getHost();
        if (host != null) {
            builder.setHost(TextUtils.toLowerCase(host));
        }
        if (builder.isPathEmpty()) {
            builder.setPathSegments("");
        }
        return builder.build();
    }
Removes dot segments and performs Syntax-Based Normalization.

@param uri the original URI
@return the URI without dot segments
httpclient5/src/main/java/org/apache/hc/client5/http/utils/URIUtils.java