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

FileDownloadUtils里的CONTENT_DISPOSITION_PATTERN正则貌似多匹配了2个引号 #908

Closed
dzbx opened this issue Jan 10, 2018 · 2 comments
Labels
Milestone

Comments

@dzbx
Copy link

dzbx commented Jan 10, 2018

注释的W3C链接(http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html) 里虽然举了个例子:attachment; filename="fname.ext",但并没有强制要求文件名必须要使用双引号,然后W3C链接里还有个RFC 1806(http://www.ietf.org/rfc/rfc1806.txt) 的链接来解释了Content-Disposition,但里面的例子里文件名并没有双引号:attachment; filename=genome.jpeg。

现在这个正则强制匹配文件名的双引号,导致没有没有双引号的时候拿不到文件名了,这是当时故意这么设计的吗?

@rantianhua
Copy link
Collaborator

是的,当时只是按照 http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html 上面设计的。

@Jacksgong Jacksgong reopened this Jan 15, 2018
@Jacksgong
Copy link
Collaborator

Jacksgong commented Jan 15, 2018

@dzbx 多谢提醒。。
@rantianhua 这个问题还是需要处理一下的。。


早期这个是参照文档,后来改用Android DownloadThread 上的这个正则。


这个问题我在1.7.0上修复吧。

@Jacksgong Jacksgong added this to the 1.7.0 milestone Jan 15, 2018
@Jacksgong Jacksgong added bug and removed question labels Jan 15, 2018
Jacksgong added a commit that referenced this issue Jan 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants