The new modperl-based server does not send weird response messages, so the response message can be used without being transformed by this method.
if(message==null && callback != null)
callback.onError(toNonNull(context.getString(no_response_returned_from_server)));
else if(message != null && callback != null)
- callback.onResult(conn.getResponseCode(), Utils.parseHttpMessage(message),
+ callback.onResult(conn.getResponseCode(), message,
toNonNull(conn.getInputStream()));
conn.disconnect();
} catch (Exception e) {
}
}
- /**
- * Parses a HTTP response message of the form <code>(part1) part2</code>, returning <code>part2</code>.
- *
- * @param message the raw HTTP response message
- * @return the extracted part
- */
- public static String parseHttpMessage(final String message){
- final int indexOfParen=message.indexOf(')');
- if(indexOfParen==-1)
- return message;
- if(indexOfParen == message.length()-1)
- return toNonNull(message.substring(1, indexOfParen));
- return toNonNull(message.substring(indexOfParen+2));
- }
-
/**
* Splits a string into words.
*