-
Notifications
You must be signed in to change notification settings - Fork 754
Can't read "contentType" from cache #76
Description
I have met a issue , when I try to get the "contentType" from cache, it always return null.
Then I checked the source code of "DiskBasedCache" and "BasicNetwork".
It turns out that in "DiskBasedCache" , the volley use "HaspMap" to save the http headers and in
"BasicNetwork" it uses "new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER)" which
is not case sensitive.
So if the server's response header, uses "content-type" rather than "Content-Type", it can work properly with a response from network but can't get contentType from the cache.
And because of this issue , you can't parse the charset from cache , and it will use the default charset which is "ISO_8859_1" , and if it doesn't match the actually charset which you should get from "content-type" , then you can't get the right response content with the right charset from cache.