Skip to content

Commit

Permalink
fix #108 error extracting information from jira
Browse files Browse the repository at this point in the history
  • Loading branch information
clockworkorange committed Dec 22, 2021
1 parent 9ce34d8 commit b0e4fdc
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import static org.slf4j.LoggerFactory.getLogger;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URL;
Expand Down Expand Up @@ -102,9 +104,9 @@ protected HttpURLConnection openConnection(final URL url) throws Exception {
protected String getResponse(final HttpURLConnection conn) throws Exception {
if (mockedRestClient == null) {
final InputStream inputStream = conn.getInputStream();
final byte[] targetArray = new byte[inputStream.available()];
inputStream.read(targetArray);
return new String(targetArray, StandardCharsets.UTF_8);
InputStreamReader inputStreamReader = new InputStreamReader(inputStream, StandardCharsets.UTF_8);
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
return bufferedReader.readLine();
}
return mockedRestClient.getResponse(conn);
}
Expand Down

0 comments on commit b0e4fdc

Please sign in to comment.