Skip to content

Commit c3d6a9d

Browse files
tomas-sexenianBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:tomas-sexenian-patch-1' into beta
1 parent 8fa665b commit c3d6a9d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

java/src/main/java/com/genexus/internet/HttpClientJavaLib.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -708,15 +708,14 @@ private void setEntityReader() throws IOException {
708708
}
709709

710710
public String getString() {
711-
if (response == null)
712-
return "";
711+
if (response == null) return "";
713712
try {
714713
this.setEntity();
714+
byte[] bytes = EntityUtils.toByteArray(entity);
715715
Charset charset = ContentType.getOrDefault(entity).getCharset();
716-
String res = EntityUtils.toString(entity, charset);
717-
if (res.matches(".*[Ã-ÿ].*")) {
718-
res = EntityUtils.toString(entity, StandardCharsets.UTF_8);
719-
}
716+
String res = new String(bytes, charset);
717+
if (res.matches(".*[Ã-ÿ].*"))
718+
res = new String(bytes, StandardCharsets.UTF_8);
720719
eof = true;
721720
return res;
722721
} catch (IOException e) {
@@ -765,4 +764,4 @@ public void cleanup() {
765764
resetErrorsAndConnParams();
766765
}
767766

768-
}
767+
}

0 commit comments

Comments
 (0)