SDK doesn't handle Unicode control characters.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu với các hàm dựng GetMetadataArg và lệnh gọi DbxUserFilesRequests.getMetadata được hiển thị trong stack trace, sau đó lần theo quá trình xác thực mẫu đường dẫn. Tái hiện đường dẫn U+2028 chưa được escape và so sánh với đầu vào đã được escape; hoàn tất khi Java SDK chấp nhận đường dẫn Unicode thực tế và gửi nó đến API mà không coi văn bản escape là một chuỗi dấu gạch chéo ngược literal.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 627
- Fork
- 463
- Merge trung bình
- 5 phút
- Pull request đã merge (30 ngày)
- 10
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của dropbox/dropbox-sdk-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dropbox/dropbox-sdk-java#536 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
dropbox/dropbox-sdk-java#560 · 6 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
dropbox/dropbox-sdk-java#550 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
dropbox/dropbox-sdk-java#542 · 1 bình luận ·
-
ListFolderArg is package-private Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
dropbox/dropbox-sdk-java#535 · 1 bình luận ·
Tất cả issue của dropbox/dropbox-sdk-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·