From 65e13ce08f30d716ccb91f046ef0801c01b805a1 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 21 May 2014 17:44:56 +0200 Subject: [PATCH] Fixed response status message string, that was trimmed after the first space. --- .../jetty/fcgi/parser/ResponseContentParser.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java index c10564e6310..83a9a79ddb1 100644 --- a/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java +++ b/jetty-fcgi/fcgi-client/src/main/java/org/eclipse/jetty/fcgi/parser/ResponseContentParser.java @@ -166,12 +166,14 @@ public class ResponseContentParser extends StreamContentParser // Need to set the response status so the // HttpParser can handle the content properly. - String[] parts = httpField.getValue().split(" "); - int code = Integer.parseInt(parts[0]); + String value = httpField.getValue(); + String[] parts = value.split(" "); + String status = parts[0]; + int code = Integer.parseInt(status); httpParser.setResponseStatus(code); - String reason = parts.length > 1 ? parts[1] : HttpStatus.getMessage(code); + String reason = parts.length > 1 ? value.substring(status.length()) : HttpStatus.getMessage(code); - notifyBegin(code, reason); + notifyBegin(code, reason.trim()); notifyHeaders(fields); } }