Fixed bug in host detection for non-SSL HTTP sockets.
This commit is contained in:
@@ -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"
|
//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();
|
String line = buffer.toString().substring(0, buffer.length() - 2).trim();
|
||||||
if(line.startsWith("Host: ")) {
|
if(line.startsWith("Host: ")) {
|
||||||
|
int colonIndex;
|
||||||
|
|
||||||
host = line.substring(6).trim();
|
host = line.substring(6).trim();
|
||||||
|
colonIndex = host.indexOf(':');
|
||||||
|
|
||||||
|
if(colonIndex > 0) {
|
||||||
|
host = host.substring(0, colonIndex);
|
||||||
|
}//if//
|
||||||
}//if//
|
}//if//
|
||||||
|
|
||||||
if(host == null) {
|
if(host == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user