From a9beef3a15278abaf37c38981c40f66f57092fca Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Sun, 7 Jan 2018 18:45:00 +0300 Subject: [PATCH] Fix behaviour of HttpUrlConnection responseCode/responseMessage --- .../java/org/teavm/classlib/java/net/THttpURLConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/net/THttpURLConnection.java b/classlib/src/main/java/org/teavm/classlib/java/net/THttpURLConnection.java index d5edde45f..84874b7fc 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/net/THttpURLConnection.java +++ b/classlib/src/main/java/org/teavm/classlib/java/net/THttpURLConnection.java @@ -87,12 +87,12 @@ public abstract class THttpURLConnection extends TURLConnection { } public int getResponseCode() throws IOException { - getInputStream(); + connect(); return responseCode; } public String getResponseMessage() throws IOException { - getInputStream(); + connect(); return responseMessage; }