Fixed bug in host detection for non-SSL HTTP sockets.

This commit is contained in:
wcrisman
2014-12-29 13:22:07 -08:00
parent eb4a935562
commit 439eca5e9d

View File

@@ -1262,7 +1262,14 @@ private boolean processRequestedHost(ByteBuffer fragment) throws IOException {
//If we have the minimum number of bytes and the last bytes are a line end, then check the line for "Host: xxxxxxx\r\n"
String line = buffer.toString().substring(0, buffer.length() - 2).trim();
if(line.startsWith("Host: ")) {
int colonIndex;
host = line.substring(6).trim();
colonIndex = host.indexOf(':');
if(colonIndex > 0) {
host = host.substring(0, colonIndex);
}//if//
}//if//
if(host == null) {