getB2FileInfo throws IllegalArgumentException on a value with a stray percent sign
维护者通常 3 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 core/src/main/java/com/backblaze/b2/client/contentSources/B2Headers.java 中的 getB2FileInfo(约第 216 行,该值在此传给 URLDecoder)开始,然后阅读 core/src/main/java/com/backblaze/b2/util/B2StringUtil.java 中的 percentDecode。与 B2Headers.java 中第 130-136 行附近的处理方式进行比较,那里已经处理了类似的失败情况。当 100% 这样的值不再抛出 IllegalArgumentException 并保留原始值时即完成。通过一个测试进行验证:该测试使用 X-Bz-Info-note: 100% 构建 B2HeadersImpl 并调用 getB2FileInfo()。
由索引模型根据 Issue 内容生成。
描述
What happens
getB2FileInfo() percent-decodes each file info value with URLDecoder, which throws IllegalArgumentException for a malformed sequence such as 100%. Building a file version from download headers calls it, so the whole download fails for a file whose info value was stored raw by another client. getFileNameOrNull() in the same interface catches the same exception and returns null.
Where
core/src/main/java/com/backblaze/b2/client/contentSources/B2Headers.java:210-219 (getB2FileInfo, decode at :216), core/src/main/java/com/backblaze/b2/util/B2StringUtil.java:46-52 (percentDecode), called from core/src/main/java/com/backblaze/b2/client/B2StorageClientWebifierImpl.java:618. Compare B2Headers.java:130-136.
Why it matters
Impact: Availability (a download or metadata read fails), loud. Severity: High, because it needs a file info value stored with an unencoded percent sign by a client other than this SDK (unusual), and there is no workaround for that file besides a different client.
How to check
Found by reading the code, not reproduced. Read getB2FileInfo and percentDecode. A test could build B2HeadersImpl with X-Bz-Info-note: 100% and call getB2FileInfo(). Catching IllegalArgumentException and keeping the raw value would avoid the failure.
Version
Seen at v6.5.0. Present on the default branch: present.
- 主要语言
- Java
- 星标
- 103
- 派生
- 23
- 平均合并
- 5 天 8 小时
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Backblaze/b2-sdk-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
Backblaze/b2-sdk-java#248 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
Backblaze/b2-sdk-java#247 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
Backblaze/b2-sdk-java#245 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Backblaze/b2-sdk-java#242 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Backblaze/b2-sdk-java#241 ·
维护者通常 3 天内回复
查看 Backblaze/b2-sdk-java 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 72/100
IETF-Hackathon/pqc-certificates#351 ·
维护者通常 2 天内回复
-
bug(core): skip_nodes.json is missing SELECT and PRE, causing Python and Java to insert separators into dropdown options and preformatted text可能已有人在做 @Bhumit267 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
ExceptionThrowShouldUseContext: NullPointerException on a catch block inside an annotation type可能已有人在做 @Carbon14-48 今天认领。 未关闭approved
难度 2/5 1-3 小时 新手友好度 72/100
checkstyle/checkstyle#22784 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复