Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

SDK doesn't handle Unicode control characters.

Aperta
#490 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
api

Direzione di ricerca

Inizia con i costruttori di GetMetadataArg e la chiamata DbxUserFilesRequests.getMetadata mostrati nello stack trace, quindi segui la convalida del pattern del percorso. Riproduci il percorso U+2028 non sottoposto a escape e confrontalo con l'input sottoposto a escape; l'attività è completata quando Java SDK accetta il percorso Unicode effettivo e lo invia all'API senza trattare il testo di escape come una sequenza letterale di backslash.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

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.

Lingua principale
Java
Stelle
627
Fork
463
Merge medio
17h 12m
PR unite (30g)
10

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dropbox/dropbox-sdk-java

Tutte le issue di dropbox/dropbox-sdk-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.