mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-18 06:02:21 +08:00
修复rtsp basic鉴权相关bug: #2087
This commit is contained in:
@@ -537,10 +537,8 @@ void RtspPusher::sendRtspRequest(const string &cmd, const string &url,const StrC
|
||||
printer << "response=\"" << response << "\"";
|
||||
header.emplace("Authorization", printer);
|
||||
} else if (!(*this)[Client::kRtspPwdIsMD5].as<bool>()) {
|
||||
//base64认证
|
||||
string authStr = StrPrinter << (*this)[Client::kRtspUser] << ":" << (*this)[Client::kRtspPwd];
|
||||
char authStrBase64[1024] = {0};
|
||||
av_base64_encode(authStrBase64, sizeof(authStrBase64), (uint8_t *) authStr.data(), (int)authStr.size());
|
||||
// base64认证
|
||||
auto authStrBase64 = encodeBase64((*this)[Client::kRtspUser] + ":" + (*this)[Client::kRtspPwd]);
|
||||
header.emplace("Authorization", StrPrinter << "Basic " << authStrBase64);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user