diff --git a/okhttp/src/main/java/com/squareup/okhttp/internal/http/SpdyTransport.java b/okhttp/src/main/java/com/squareup/okhttp/internal/http/SpdyTransport.java index 5ed951090..5f35582c0 100644 --- a/okhttp/src/main/java/com/squareup/okhttp/internal/http/SpdyTransport.java +++ b/okhttp/src/main/java/com/squareup/okhttp/internal/http/SpdyTransport.java @@ -28,7 +28,7 @@ import java.net.CacheRequest; import java.net.ProtocolException; import java.net.URL; import java.util.ArrayList; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.List; import java.util.Locale; import java.util.Set; @@ -102,8 +102,8 @@ public final class SpdyTransport implements Transport { * values, they are concatenated using "\0" as a delimiter. */ public static List writeNameValueBlock(Headers headers) { - Set names = new HashSet(); - List result = new ArrayList(); + Set names = new LinkedHashSet(); + List result = new ArrayList(headers.length() * 2); for (int i = 0; i < headers.length(); i++) { String name = headers.getFieldName(i).toLowerCase(Locale.US); String value = headers.getValue(i);