Skip to content

Commit

Permalink
fix: get connection info from redirect connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianhua Ran committed Nov 7, 2019
1 parent ddde3dc commit f1d79cc
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,27 +95,35 @@ public String getRequestProperty(String key) {

@Override
public int getResponseCode() throws IOException {
if (redirectConnectAdapter != null) redirectConnectAdapter.getResponseCode();
if (redirectConnectAdapter != null) {
return redirectConnectAdapter.getResponseCode();
}
return fileDownloadConnection.getResponseCode();
}

@Override
public InputStream getInputStream() throws IOException {
if (redirectConnectAdapter != null) redirectConnectAdapter.getInputStream();
if (redirectConnectAdapter != null) {
return redirectConnectAdapter.getInputStream();
}
return fileDownloadConnection.getInputStream();
}

@Nullable
@Override
public Map<String, List<String>> getResponseHeaderFields() {
if (redirectConnectAdapter != null) redirectConnectAdapter.getResponseHeaderFields();
if (redirectConnectAdapter != null) {
return redirectConnectAdapter.getResponseHeaderFields();
}
return fileDownloadConnection.getResponseHeaderFields();
}

@Nullable
@Override
public String getResponseHeaderField(String name) {
if (redirectConnectAdapter != null) redirectConnectAdapter.getResponseHeaderField(name);
if (redirectConnectAdapter != null) {
return redirectConnectAdapter.getResponseHeaderField(name);
}
return fileDownloadConnection.getResponseHeaderField(name);
}

Expand Down

0 comments on commit f1d79cc

Please sign in to comment.