SDK doesn't handle Unicode control characters.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with the GetMetadataArg constructors and the DbxUserFilesRequests.getMetadata call shown in the stack trace, then trace the path pattern validation. Reproduce the unescaped U+2028 path and compare it with the escaped input; done means the Java SDK accepts the actual Unicode path and sends it to the API without treating the escape text as a literal backslash sequence.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Java
- Stars
- 627
- Forks
- 463
- Avg merge
- 5m
- Merged PRs (30d)
- 10
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dropbox/dropbox-sdk-java
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
dropbox/dropbox-sdk-java#536 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
dropbox/dropbox-sdk-java#560 · 6 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
dropbox/dropbox-sdk-java#550 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
dropbox/dropbox-sdk-java#542 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
dropbox/dropbox-sdk-java#535 · 1 comment ·
All issues in dropbox/dropbox-sdk-java
Similar issues
-
area/plugin
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kestra-io/plugin-kestra#190 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
apache/rocketmq-dashboard#5064 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
wso2/dpdp-accelerator#287 ·