diff options
author | Max Kellermann <max@musicpd.org> | 2020-04-23 17:54:22 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-04-23 18:01:23 +0200 |
commit | 0b3acc3eec1688d58120921b2dc58ae64851354c (patch) | |
tree | efa25cb96e9e8bd10b5a04d2e087e9a993929b5f /src/storage | |
parent | 6979be008cb334ca08fc031ecb86a723bf656381 (diff) | |
parent | 6c240f667c391f678dd916d0a1d7e9b149557240 (diff) |
Merge tag 'v0.21.23'
release v0.21.23
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/plugins/CurlStorage.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx index d2fc24150..356fa8b58 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -394,7 +394,7 @@ private: break; case State::HREF: - response.href.assign(s, len); + response.href.append(s, len); break; case State::STATUS: @@ -474,7 +474,7 @@ class HttpListDirectoryOperation final : public PropfindOperation { public: HttpListDirectoryOperation(CurlGlobal &curl, const char *uri) :PropfindOperation(curl, uri, 1), - base_path(UriPathOrSlash(uri)) {} + base_path(CurlUnescape(GetEasy(), UriPathOrSlash(uri))) {} std::unique_ptr<StorageDirectoryReader> Perform() { DeferStart(); @@ -499,8 +499,7 @@ private: /* kludge: ignoring case in this comparison to avoid false negatives if the web server uses a different - case in hex digits in escaped characters; TODO: - implement properly */ + case */ path = StringAfterPrefixIgnoreCase(path, base_path.c_str()); if (path == nullptr || path.empty()) return nullptr; @@ -523,11 +522,12 @@ protected: if (r.status != 200) return; - const auto escaped_name = HrefToEscapedName(r.href.c_str()); - if (escaped_name.IsNull()) + std::string href = CurlUnescape(GetEasy(), r.href.c_str()); + const auto name = HrefToEscapedName(href.c_str()); + if (name.IsNull()) return; - entries.emplace_front(CurlUnescape(GetEasy(), escaped_name)); + entries.emplace_front(std::string(name.data, name.size)); auto &info = entries.front().info; info = StorageFileInfo(r.collection |