Merge pull request #37 from TFyre/master

Processing multi-line contents
This commit is contained in:
Gideon le Grange 2016-10-06 22:26:41 +02:00 committed by GitHub
commit 2b5ade26fa
2 changed files with 8 additions and 0 deletions

View File

@ -312,6 +312,14 @@ public final class ApiConnectionImpl extends ApiConnection {
if (parts.length == 3) { if (parts.length == 3) {
if (!parts[2].endsWith("\r")) { if (!parts[2].endsWith("\r")) {
res.put(parts[1], unpackResult(parts[2])); res.put(parts[1], unpackResult(parts[2]));
} else {
final StringBuilder sb = new StringBuilder();
sb.append(parts[2]);
while (!lines.isEmpty()) {
nextLine();
sb.append(line);
}
res.put(parts[1], sb.toString());
} }
} else { } else {
throw new ApiDataException(String.format("Malformed line '%s'", line)); throw new ApiDataException(String.format("Malformed line '%s'", line));