diff options
author | Max Kellermann <max@musicpd.org> | 2019-10-15 16:12:01 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2019-10-15 16:26:53 +0200 |
commit | 56cc42b7522c46d616c88db0a6261578b121dc9d (patch) | |
tree | d6f0f71a367d03b5b471ae3fb2fe12384ef149fe | |
parent | ead208987ddf27f97bac7ccf7887e318a2550be7 (diff) |
storage/curl: use MapUTF8() to reuse existing escaping code
Commit 29f78b18b1d continued.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/662
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/storage/plugins/CurlStorage.cxx | 9 |
2 files changed, 3 insertions, 7 deletions
@@ -1,6 +1,7 @@ ver 0.21.16 (not yet released) * storage - curl: request the "resourcetype" property to fix database update + - curl: URL-encode more paths * update - fix crash when music_directory is not a directory * fix build with iconv() instead of ICU diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index 8f2dea64f..3790cc5a8 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -445,9 +445,7 @@ CurlStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow) { // TODO: escape the given URI - std::string uri = base; - uri += uri_utf8; - + const auto uri = MapUTF8(uri_utf8); return HttpGetInfoOperation(*curl, uri.c_str()).Perform(); } @@ -537,10 +535,7 @@ protected: std::unique_ptr<StorageDirectoryReader> CurlStorage::OpenDirectory(const char *uri_utf8) { - // TODO: escape the given URI - - std::string uri = base; - uri += uri_utf8; + std::string uri = MapUTF8(uri_utf8); /* collection URIs must end with a slash */ if (uri.back() != '/') |