Index: InternalInputBuffer.java =================================================================== --- InternalInputBuffer.java (revision 1231) +++ InternalInputBuffer.java (working copy) @@ -421,7 +421,8 @@ throw new EOFException(sm.getString("iib.eof.error")); } - if (buf[pos] == Constants.SP) { + // Spec says single SP but it also says be tolerant of HT + if (buf[pos] == Constants.SP || buf[pos] == Constants.HT) { space = true; request.method().setBytes(buf, start, pos - start); } @@ -429,7 +430,20 @@ pos++; } - + // Spec says single SP but also says be tolerant of multiple and/or HT + while (space) { + // Read new bytes if needed + if (pos >= lastValid) { + if (!fill()) + throw new EOFException(sm.getString("iib.eof.error")); + } + if (buf[pos] == Constants.SP || buf[pos] == Constants.HT) { + pos++; + } else { + space = false; + } + } + // Mark the current buffer position start = pos; end = 0; @@ -439,7 +453,6 @@ // Reading the URI // - space = false; boolean eol = false; while (!space) { @@ -449,7 +462,8 @@ throw new EOFException(sm.getString("iib.eof.error")); } - if (buf[pos] == Constants.SP) { + // Spec says single SP but it also says be tolerant of HT + if (buf[pos] == Constants.SP || buf[pos] == Constants.HT) { space = true; end = pos; } else if ((buf[pos] == Constants.CR) @@ -476,6 +490,20 @@ request.requestURI().setBytes(buf, start, end - start); } + // Spec says single SP but also says be tolerant of multiple and/or HT + while (space) { + // Read new bytes if needed + if (pos >= lastValid) { + if (!fill()) + throw new EOFException(sm.getString("iib.eof.error")); + } + if (buf[pos] == Constants.SP || buf[pos] == Constants.HT) { + pos++; + } else { + space = false; + } + } + // Mark the current buffer position start = pos; end = 0;