From 439eca5e9d9d05045b7174fe04c7a52f8d665b73 Mon Sep 17 00:00:00 2001 From: wcrisman Date: Mon, 29 Dec 2014 13:22:07 -0800 Subject: [PATCH] Fixed bug in host detection for non-SSL HTTP sockets. --- .../src/com/foundation/web/server/SocketContext.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Foundation Web Core/src/com/foundation/web/server/SocketContext.java b/Foundation Web Core/src/com/foundation/web/server/SocketContext.java index ef9cdf2..dd846a5 100644 --- a/Foundation Web Core/src/com/foundation/web/server/SocketContext.java +++ b/Foundation Web Core/src/com/foundation/web/server/SocketContext.java @@ -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) {