From ba824089d7bab41569f63c4ad202e59529a47ecb Mon Sep 17 00:00:00 2001 From: CncGpp Date: Fri, 11 Jun 2021 20:39:33 +0200 Subject: [PATCH] Fix code err code 401 when the password is empty in base_auth. (#958) --- httplib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index d3cddc9..52a4768 100644 --- a/httplib.h +++ b/httplib.h @@ -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( basic_auth_username_, basic_auth_password_, false)); }