8130193: Improve HTTP connections
authormichaelm
Thu, 09 Jul 2015 13:23:03 +0100
changeset 33292 4d2290a6ce1f
parent 33291 b57cd65fbe99
child 33293 14dcba137e73
8130193: Improve HTTP connections Reviewed-by: alanb
jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
--- a/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Fri Jul 03 14:40:49 2015 +0100
+++ b/jdk/src/java.base/share/classes/sun/net/www/protocol/http/HttpURLConnection.java	Thu Jul 09 13:23:03 2015 +0100
@@ -487,7 +487,8 @@
     private void checkMessageHeader(String key, String value) {
         char LF = '\n';
         int index = key.indexOf(LF);
-        if (index != -1) {
+        int index1 = key.indexOf(':');
+        if (index != -1 || index1 != -1) {
             throw new IllegalArgumentException(
                 "Illegal character(s) in message header field: " + key);
         }