File tree Expand file tree Collapse file tree
yoti-sdk-auth/src/main/java/com/yoti/auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,14 +59,14 @@ private static String encode(String v) {
5959 private byte [] parseResponse (HttpURLConnection httpUrlConnection ) throws ResourceException , IOException {
6060 int responseCode = httpUrlConnection .getResponseCode ();
6161 if (responseCode >= HttpURLConnection .HTTP_BAD_REQUEST ) {
62- byte [] responseBody = readBody (httpUrlConnection );
62+ byte [] responseBody = readBody (httpUrlConnection . getErrorStream () );
6363 throw new ResourceException (responseCode , httpUrlConnection .getResponseMessage (), new String (responseBody ));
6464 }
65- return readBody (httpUrlConnection );
65+ return readBody (httpUrlConnection . getInputStream () );
6666 }
6767
68- private byte [] readBody (HttpURLConnection httpURLConnection ) throws IOException {
69- try (QuietCloseable <InputStream > inputStream = new QuietCloseable <>(httpURLConnection . getInputStream () )) {
68+ private byte [] readBody (InputStream httpInputStream ) throws IOException {
69+ try (QuietCloseable <InputStream > inputStream = new QuietCloseable <>(httpInputStream )) {
7070 return readChunked (inputStream .get ());
7171 }
7272 }
You can’t perform that action at this time.
0 commit comments