Commit 638dfc39 authored by Max Kellermann's avatar Max Kellermann

{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
parent 7c09e44a
ver 0.22.7 (not yet released)
* protocol
- don't use glibc extension to parse time stamps
* input
- curl: send user/password in the first request, save one roundtrip
* decoder
- ffmpeg: fix build problem with FFmpeg 3.4
- gme: support RSN files
......
......@@ -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);
......
......@@ -262,6 +262,10 @@ public:
request.SetOption(CURLOPT_FOLLOWLOCATION, 1L);
request.SetOption(CURLOPT_MAXREDIRS, 1L);
/* this option eliminates the probe request when
username/password are specified */
request.SetOption(CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
request_headers.Append(StringFormat<40>("depth: %u", depth));
request_headers.Append("content-type: text/xml");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment