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

下载TXT文件时频繁出现因响应头没有Content-Length项而终止的问题 #53

Open
Lycheenut opened this issue Mar 1, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@Lycheenut
Copy link

TXT文件的Content-Type有时被判断为text/plain因此没有Content-Length,字典不能读到content-length键而抛出异常。

@zaxtyson
Copy link
Owner

zaxtyson commented Mar 3, 2021

啊这, 的确是, 刚刚才看到, 这就去改

@zaxtyson
Copy link
Owner

zaxtyson commented Mar 3, 2021

目前 txt 文件是至少有人下载过一次之后, 才能获取到 Content-Length

@zaxtyson
Copy link
Owner

zaxtyson commented Mar 3, 2021

已经修复~
遇到无法获取 Content-Length 的情况, 先尝试读取 1 byte 数据, 此时再对资源请求一次就可以得到正确的 headers 了

@zaxtyson zaxtyson added the bug Something isn't working label Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants