8130193: Improve HTTP connections

Reviewed-by: alanb
This commit is contained in:
Michael McMahon 2015-07-09 13:23:03 +01:00
parent 391696a6f8
commit 3ca3a07d79

View File

@ -487,7 +487,8 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
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);
}