mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fix code err code 401 when the password is empty in base_auth. (#958)
This commit is contained in:
parent
1a2faf09e0
commit
ba824089d7
1 changed files with 1 additions and 1 deletions
|
@ -5696,7 +5696,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!basic_auth_password_.empty()) {
|
if (!basic_auth_password_.empty() || !basic_auth_username_.empty()) {
|
||||||
req.headers.insert(make_basic_authentication_header(
|
req.headers.insert(make_basic_authentication_header(
|
||||||
basic_auth_username_, basic_auth_password_, false));
|
basic_auth_username_, basic_auth_password_, false));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue