summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFicus Kirkpatrick <ficus@android.com>2014-10-09 01:31:23 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2014-10-09 01:31:23 +0000
commitb87331c8b80f2cbabce4eb9979cca3917dd02600 (patch)
tree703550f96529fc1384e1468a6ba6751df6c33b41 /src
parent1cd7f9e9e9e67fba1a375bdc136aed8e55f39809 (diff)
parentba53551261044a9811835c1fb89d4ec48a88a43b (diff)
downloadvolley-b87331c8b80f2cbabce4eb9979cca3917dd02600.tar.gz
Merge "HTTP headers are case insensitive per RFC 2616 ยง4.2 "Message Headers""android-l-preview_r2l-preview
Diffstat (limited to 'src')
-rw-r--r--src/com/android/volley/toolbox/BasicNetwork.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/volley/toolbox/BasicNetwork.java b/src/com/android/volley/toolbox/BasicNetwork.java
index 42696e2..c76ef6a 100644
--- a/src/com/android/volley/toolbox/BasicNetwork.java
+++ b/src/com/android/volley/toolbox/BasicNetwork.java
@@ -44,9 +44,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
/**
* A network performing Volley requests over an {@link HttpStack}.
@@ -86,7 +88,7 @@ public class BasicNetwork implements Network {
while (true) {
HttpResponse httpResponse = null;
byte[] responseContents = null;
- Map<String, String> responseHeaders = new HashMap<String, String>();
+ Map<String, String> responseHeaders = Collections.emptyMap();
try {
// Gather headers.
Map<String, String> headers = new HashMap<String, String>();
@@ -251,8 +253,8 @@ public class BasicNetwork implements Network {
/**
* Converts Headers[] to Map<String, String>.
*/
- private static Map<String, String> convertHeaders(Header[] headers) {
- Map<String, String> result = new HashMap<String, String>();
+ protected static Map<String, String> convertHeaders(Header[] headers) {
+ Map<String, String> result = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
for (int i = 0; i < headers.length; i++) {
result.put(headers[i].getName(), headers[i].getValue());
}