From f0386459ee5759fe1ff54eacc34525b03901ba6b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 15 Oct 2019 16:42:39 +0200 Subject: [PATCH] storage/curl: follow redirects for collections without trailing slash --- NEWS | 1 + src/storage/plugins/CurlStorage.cxx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index c0d175464..48a489178 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.21.16 (not yet released) * storage - curl: request the "resourcetype" property to fix database update - curl: URL-encode more paths + - curl: follow redirects for collections without trailing slash * 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 13150d920..581a0cca4 100644 --- a/src/storage/plugins/CurlStorage.cxx +++ b/src/storage/plugins/CurlStorage.cxx @@ -259,6 +259,8 @@ public: CommonExpatParser(ExpatNamespaceSeparator{'|'}) { request.SetOption(CURLOPT_CUSTOMREQUEST, "PROPFIND"); + request.SetOption(CURLOPT_FOLLOWLOCATION, 1l); + request.SetOption(CURLOPT_MAXREDIRS, 1l); request_headers.Append(StringFormat<40>("depth: %u", depth));