Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected Response<T> parseNetworkResponse(NetworkResponse response) {
try {
networkResponse = response;
String responseString = "";
final String encoding = response.headers.get("Content-Encoding");
final String encoding = getEncoding(response.headers);
if(encoding!=null && encoding.contains("gzip")) {
responseString = decodeGZip(response.data);
} else {
Expand All @@ -126,7 +126,17 @@ protected Response<T> parseNetworkResponse(NetworkResponse response) {
return Response.error(new UnknownVolleyError(e));
}
}


private String getEncoding(Map<String, String> headers){
if(headers.get("Content-Encoding") != null){
return headers.get("Content-Encoding");
}
if(headers.get("content-encoding") != null){
return headers.get("content-encoding");
}
return null;
}

private String decodeGZip(byte[] data) throws Exception {
String responseString = "";

Expand Down