mcxiaoke / android-volley

DEPRECATED
4.29k stars 1.56k forks source link

Missing some response header in Map<String,String> #126

Open sepbehroozi opened 8 years ago

sepbehroozi commented 8 years ago

In response header sometimes we have multiple headers with same name like Set-Cookie: In com.android.volley.toolbox.BasicNetwork.java file last static method called convertHeaders(Header[] headers) that returns a Map<String,String>. We should use another data structure instead of Map<String,String> for handle headers with the same name conflict

Responses may have multiple separated Set-Cookie: names in header like this :

Cache-Control:no-cache
Connection:Keep-Alive
Content-Type:application/json
Date:Tue, 15 Dec 2015 14:37:12 GMT
device-id:unknown_565d....
Proxy-Connection:Keep-Alive
Server:Apache
Set-Cookie:device_id=eyJpdiI6Ik4zYXY4VlJXM....; expires=Sun, 13-Dec-2020 14:37:13 GMT; Max-Age=157680000; path=/; httponly
Set-Cookie:laravel_session=eyJpdiI6ImdSS0R....; expires=Tue, 15-Dec-2015 15:07:13 GMT; Max-Age=1800; path=/; httponly
Set-Cookie:cartalyst_sentry=eyJpdiI6IlZmdm....; expires=Sun, 13-Dec-2020 14:37:12 GMT; Max-Age=157679999; path=/; httponly
Transfer-Encoding:chunked
Via:1.1 STD-SRV-2112
X-AndroidApp-VersionCode:2
X-AndroidApp-VersionName:2.0.0
X-IOSApp-VersionCode:2
X-IOSApp-VersionName:2.0.0