Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

启用缓存后, 请求部分链接导致crash #519

Open
kuroyukihime0 opened this issue Dec 13, 2024 · 2 comments
Open

启用缓存后, 请求部分链接导致crash #519

kuroyukihime0 opened this issue Dec 13, 2024 · 2 comments

Comments

@kuroyukihime0
Copy link

测试链接: https://dc.crsorgi.gov.in/crs/verifyCertificate?id=

请求header里没有额外参数, 应该是响应头的header里带了非Ascii字符, 导致构造返回时出问题了

java.lang.IllegalArgumentException: Unexpected char 0x20 at 0 in header name: script-src 'self' 'unsafe-inline' 'unsafe-eval' dc.crsorgi.gov.in csi.gstatic.com www.google.com localhost.emudhra.com
at okhttp3.Headers$Companion.checkName(Headers.kt:441)
at okhttp3.Headers$Companion.access$checkName(Headers.kt:362)
at okhttp3.Headers$Builder.addUnsafeNonAscii(Headers.kt:270)
at rxhttp.wrapper.cache.CacheManager$Entry.addUnsafeNonAscii(CacheManager.java:519)
at rxhttp.wrapper.cache.CacheManager$Entry.(CacheManager.java:477)
at rxhttp.wrapper.cache.CacheManager.get(CacheManager.java:124)
at rxhttp.wrapper.cache.CacheManager.access$000(CacheManager.java:56)
at rxhttp.wrapper.cache.CacheManager$1.get(CacheManager.java:67)
at rxhttp.wrapper.intercept.CacheInterceptor.getCacheResponse(CacheInterceptor.

@liujingxing
Copy link
Owner

接口我请求不了,无法复现,不过从日志来看,是响应头名称有非法字符(第一个字符是空格),此问题暂时无解。不过你可以关闭缓存试试,理论上也是不行的

@kuroyukihime0
Copy link
Author

接口我请求不了,无法复现,不过从日志来看,是响应头名称有非法字符(第一个字符是空格),此问题暂时无解。不过你可以关闭缓存试试,理论上也是不行的

是的,是接口返回response的header里有非法字符,only network没事,开启缓存后从缓存读就会crash, (比较难受的是这个还trycatch不住)

现在暂时取消缓存解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants