akka/akka-http

Uri.Path() is ambiguous about accepting % encoded vs not encoded

Open

#2.577 geöffnet am 25. Juni 2019

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Scala (598 Forks)batch import
1 - triageddiscusshelp wantedt:coret:docst:model

Repository-Metriken

Stars
 (1.311 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 10h) (2 gemergte PRs in 30 T)

Beschreibung

If you put characters that should be percent-encoded in a string passed to Uri.Path(), it will automatically percent-encode them (e.g. turn a space into %20). Unless the character itself is a percent, in which case it assumes you are trying to percent encode this. I guess this is sort of by design, but the ambiguity definitely can create bugs. Ideally there'd be two variants you could pass to, one that expected unencoded input and encoded everything (including %), and another that expects encoded input and rejects characters that need to be percent-encoded.

Contributor Guide