cocos / engine-native Public
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
修复断点续传功能bug #1931
修复断点续传功能bug #1931
Conversation
感谢贡献,有论坛id么,我们可以给你一个论坛的头衔 |
论坛id是gaolizheng,备感荣幸 @holycanvas |
谢啦。已标注为“Cocos 开源贡献者” |
是我们的荣幸才是 |
@@ -190,7 +190,7 @@ public void onResponse(Call call, Response response) throws IOException { | |||
|
|||
try { | |||
|
|||
if(response.code() != 200) { | |||
if(response.code() != 200 && response.code() != 206) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
根据规范, 200~299 内的状态码都可以当作下载成功。 建议把条件放宽为
response.code() >= 200 && response.code() <= 206
代码204,205
也是有可能出现的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
204 No Content
服务器成功处理了请求,但不需要返回任何实体内容
205 Reset Content
服务器成功处理了请求,且没有返回任何内容。
个人感觉针对下载文件这个需求来说,出现204或者205应该都是开发者不希望的情况吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按照规范 204/205 也算作“成功”的状态, 具体是否会“出现” 取决于服务器的实现。我认为尽量按照规范处理是比较合理的。
已经修改成状态码200-206均视为成功 |
你好,能改为用英文写commit的信息么,pr里面可以用中文写,commit里面最好不出现中文,毕竟开源项目 |
可以用英文,但是我已经push上去的commit没法改了吧,我该怎么操作 |
可以改的,现在你本地改了后用 push -f 强推就可以覆盖你之前的commit |
改了,但是好像只能改最后一次的commit信息 |
git rebase 命令可以重新写注释信息,然后再强推就行了 |
学到了,已改。 |
感谢你的贡献 |
修复断点续传功能bug