diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-02 10:38:20 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-02 11:01:45 +0200 |
commit | 906972973e5ff849cfea2e786b6d304057dfc529 (patch) | |
tree | eed11ea82535da7f63404125a012e13e4bdda294 /src/LocateUri.cxx | |
parent | 116edf5fcea825455fcf212afebea547d28ad9f5 (diff) |
case-insensitive URI scheme comparison
Required according to RFC 3986:
> An implementation should accept uppercase letters as equivalent to
> lowercase in scheme names
Closes #330
Diffstat (limited to 'src/LocateUri.cxx')
-rw-r--r-- | src/LocateUri.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/LocateUri.cxx b/src/LocateUri.cxx index 3c0a88584..0c16921a0 100644 --- a/src/LocateUri.cxx +++ b/src/LocateUri.cxx @@ -23,7 +23,7 @@ #include "fs/AllocatedPath.hxx" #include "ls.hxx" #include "util/UriUtil.hxx" -#include "util/StringCompare.hxx" +#include "util/ASCII.hxx" #ifdef ENABLE_DATABASE #include "storage/StorageInterface.hxx" @@ -83,7 +83,7 @@ LocateUri(const char *uri, const Client *client ) { /* skip the obsolete "file://" prefix */ - const char *path_utf8 = StringAfterPrefix(uri, "file://"); + const char *path_utf8 = StringAfterPrefixCaseASCII(uri, "file://"); if (path_utf8 != nullptr) { if (!PathTraitsUTF8::IsAbsolute(path_utf8)) throw std::runtime_error("Malformed file:// URI"); |