Explorar o código

Fix code err code 401 when the password is empty in base_auth. (#958)

CncGpp %!s(int64=4) %!d(string=hai) anos
pai
achega
ba824089d7
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      httplib.h

+ 1 - 1
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));
   }