SDK doesn't handle Unicode control characters.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
先从 stack trace 中所示的 GetMetadataArg 构造函数和 DbxUserFilesRequests.getMetadata 调用开始,然后跟踪路径模式验证。重现未转义的 U+2028 路径,并将其与转义后的输入进行比较;完成的标准是 Java SDK 接受实际的 Unicode 路径,并将其发送到 API,而不把转义文本当作字面反斜杠序列处理。
由索引模型根据 Issue 内容生成。
描述
Basically I have a code that does this:
private final DbxUserFilesRequests files;
@SneakyThrows
public Metadata getMetadata(String path) {
return files.getMetadata(path);
}
This works for normal paths that don't contain control characters.
However, if you supply path that contains the Unicode Control Characters that aren't escaped:
/SomeFolder/acces
s_token.txt
It spits out this issue:
java.lang.IllegalArgumentException: String 'path' does not match pattern
at com.dropbox.core.v2.files.GetMetadataArg.<init>(GetMetadataArg.java:58)
at com.dropbox.core.v2.files.GetMetadataArg.<init>(GetMetadataArg.java:80)
at com.dropbox.core.v2.files.DbxUserFilesRequests.getMetadata(DbxUserFilesRequests.java:1602)
But if you escape the path from unicode characters like this:
acces\u2028s_token.txt
It seems that the library escapes the backslash character, and causes the API to return the Malformed path response.
"error": {
".tag": "path",
"path": {
".tag": "malformed_path"
}
}
Unfortunately, I don't really have a choice in renaming the file. Is there a solution we can have to handle the unicode control? Like another method that allows us to supply a string that won't be processed by the SDK?
I know from cURL, it's possible to use the escaped form of the unicode character and get the metadata. However, it's just not a choice I have from the java SDK since it won't do it for me, and it doesn't like the escaped version of unicode.
- 主要语言
- Java
- 星标
- 627
- 派生
- 463
- 平均合并
- 14 小时 20 分钟
- 30 天内合并 PR
- 12
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
dropbox/dropbox-sdk-java 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
dropbox/dropbox-sdk-java#536 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
dropbox/dropbox-sdk-java#560 · 6 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
dropbox/dropbox-sdk-java#550 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 15/100
dropbox/dropbox-sdk-java#542 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
dropbox/dropbox-sdk-java#535 · 1 条评论 ·
维护者通常 1 天内回复
查看 dropbox/dropbox-sdk-java 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
apache/skywalking#14120 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
micronaut-projects/micronaut-core#13677 ·
维护者通常 1 天内回复
-
new feature
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
apache/rocketmq-dashboard#5594 ·
维护者通常 3 天内回复