Skip to content

Can't read "contentType" from cache #76

@dingbuoyi

Description

@dingbuoyi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions