Trinea / android-common

Android common lib, include ImageCache, HttpCache, DropDownListView, DownloadManager, Utils and so on
http://p.codekk.com/
5.01k stars 2.65k forks source link

HttpResponse getCacheControlMaxAge 返回值用int过小 #12

Closed at15 closed 9 years ago

at15 commented 9 years ago

比如缓存一个月的话 maxAge = 30 * 24 * 60 * 60 = 2592000 然后 maxAge * 1000 就超过了int的范围变成了负数,然后expireTime就永远在当前时间之前了.缓存就永远失败了.

https://github.com/Trinea/android-common/blob/master/src/cn/trinea/android/common/entity/HttpResponse.java

232 行改成long应该就可以了吧? 否则267行那里就会导致 maxAge * 1000 变成 -1702967296

Trinea commented 9 years ago

已修改,这类问题你可以直接提交 pr,https://help.github.com/articles/syncing-a-fork/