Permalink
Browse files

Merge pull request #8 from xhanin/master

TFJ-662 Bug with content-encoding: gzip on GAE with current twitter service
  • Loading branch information...
2 parents ed80044 + 2b12d03 commit 7a6084e644242d018c279dc332bb4691a18f55b1 @yusuke yusuke committed Jun 4, 2012
@@ -37,6 +37,7 @@
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
+import java.util.Locale;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.zip.GZIPInputStream;
@@ -161,11 +162,11 @@ private void ensureResponseEvaluated() {
statusCode = r.getResponseCode();
headers = new HashMap<String, String>();
for (HTTPHeader h : r.getHeaders()) {
- headers.put(h.getName(), h.getValue());
+ headers.put(h.getName().toLowerCase(Locale.ENGLISH), h.getValue());
}
byte[] content = r.getContent();
is = new ByteArrayInputStream(content);
- if ("gzip".equals(headers.get("Content-Encoding"))) {
+ if ("gzip".equals(headers.get("content-encoding"))) {
// the response is gzipped
try {
is = new GZIPInputStream(is);

0 comments on commit 7a6084e

Please sign in to comment.