summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2021-05-17 19:24:12 +0200
committerMax Kellermann <max@musicpd.org>2021-05-17 19:26:05 +0200
commit638dfc398184ff0d71c2a81c8c3eb99f649ac307 (patch)
treef46676a68767a47047acbcb0297ada3e6df9e4f3 /src/input
parent7c09e44ad46b65765a0d63627ea203fca68825ff (diff)
{input,storage}/curl: set CURLOPT_HTTPAUTH=CURLAUTH_BASIC
With the default value CURLAUTH_ANY, libcurl needs to probe for authentication methods first, and only the second request will have an Authorization header. Closes https://github.com/MusicPlayerDaemon/MPD/issues/1155
Diffstat (limited to 'src/input')
-rw-r--r--src/input/plugins/CurlInputPlugin.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/input/plugins/CurlInputPlugin.cxx b/src/input/plugins/CurlInputPlugin.cxx
index 86647f550..b3b6a9652 100644
--- a/src/input/plugins/CurlInputPlugin.cxx
+++ b/src/input/plugins/CurlInputPlugin.cxx
@@ -421,6 +421,10 @@ CurlInputStream::InitEasy()
request->SetOption(CURLOPT_MAXREDIRS, 5L);
request->SetOption(CURLOPT_FAILONERROR, 1L);
+ /* this option eliminates the probe request when
+ username/password are specified */
+ request->SetOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
+
if (proxy != nullptr)
request->SetOption(CURLOPT_PROXY, proxy);