diff --git a/src/main/java/io/vertx/core/http/impl/HttpUtils.java b/src/main/java/io/vertx/core/http/impl/HttpUtils.java index 238341a1dcc..ada1b027ab7 100644 --- a/src/main/java/io/vertx/core/http/impl/HttpUtils.java +++ b/src/main/java/io/vertx/core/http/impl/HttpUtils.java @@ -863,7 +863,32 @@ public static void validateHeader(CharSequence name, Iterable 0x7f) { + throw new IllegalArgumentException("a header name cannot contain non-ASCII character: " + value); + } + if (!VALID_H_NAME_ASCII_CHARS[c & 0x7F]) { + throw new IllegalArgumentException("a header name cannot contain some prohibited characters, such as : " + value); + } + } + } + + private static void validateSequenceHeaderName(CharSequence value) { for (int i = 0; i < value.length(); i++) { final char c = value.charAt(i); // Check to see if the character is not an ASCII character, or invalid