OkHttp extension - properly use response headers instead of request headers when throwing InvalidResponseCodeException

This commit is contained in:
Justin Yorke 2018-04-19 17:08:16 -07:00
parent d4eb2e5b85
commit 3f3191bb75
No known key found for this signature in database
GPG Key ID: F14A1056CB1757BB

View File

@ -170,7 +170,7 @@ public class OkHttpDataSource implements HttpDataSource {
// Check for a valid response code.
if (!response.isSuccessful()) {
Map<String, List<String>> headers = request.headers().toMultimap();
Map<String, List<String>> headers = response.headers().toMultimap();
closeConnectionQuietly();
InvalidResponseCodeException exception = new InvalidResponseCodeException(
responseCode, headers, dataSpec);