Skip to content

Commit ba82408

Browse files
authored
Fix code err code 401 when the password is empty in base_auth. (yhirose#958)
1 parent 1a2faf0 commit ba82408

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httplib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5696,7 +5696,7 @@ inline bool ClientImpl::write_request(Stream &strm, Request &req,
56965696
}
56975697
}
56985698

5699-
if (!basic_auth_password_.empty()) {
5699+
if (!basic_auth_password_.empty() || !basic_auth_username_.empty()) {
57005700
req.headers.insert(make_basic_authentication_header(
57015701
basic_auth_username_, basic_auth_password_, false));
57025702
}

0 commit comments

Comments
 (0)