public static String schemeValidateAndNormalize(String scheme) {
        final boolean isValidScheme = SCHEME_PATTERN.matcher(scheme).matches();
        if (isValidScheme) {
            return Ascii.toLowerCase(scheme);
        } else {
            throw new IllegalArgumentException("scheme: " + scheme + " (expected: a valid scheme)");
        }
    }
Returns normalized scheme.

@throws IllegalArgumentException if the provided {@code scheme} does not conform to the criteria
                                 specified in RFC 3986.
core/src/main/java/com/linecorp/armeria/internal/common/ArmeriaHttpUtil.java