hapi-hl7v2 icon indicating copy to clipboard operation
hapi-hl7v2 copied to clipboard

HL7overHttp

Open bartdemaeyer opened this issue 6 years ago • 0 comments

In the class 'AbstractHl7OverHttpDecoder' method 'private String readLine(InputStream theInputStream, boolean theFirstLine)' in the return statement 'return WHITESPACE_PATTERN.matcher(retVal.toString()).replaceAll(" ").trim();' the result is trimmed this gives problems in the code class 'Hl7OverHttpResponseDecoder' in the method 'readActionLineAndDecode' code ' String statusPart = firstLine.substring(9); int spaceIdx = statusPart.indexOf(' '); if (spaceIdx == -1) { throw new DecodeException("Invalid response line, no space after status code. Line is: " + firstLine); } because the last ' ' is removed by the trim in the readLine, so always an error is thrown.
Removing the trim solves the problem for me.

bartdemaeyer avatar Apr 03 '18 18:04 bartdemaeyer