mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-29 14:45:55 +08:00
修改cookie设置的bug
This commit is contained in:
parent
8e4a2f25ba
commit
92d35f885a
@ -247,15 +247,23 @@ void HttpClient::checkCookie(HttpClient::HttpHeader &headers) {
|
|||||||
HttpCookie::Ptr cookie = std::make_shared<HttpCookie>();
|
HttpCookie::Ptr cookie = std::make_shared<HttpCookie>();
|
||||||
cookie->setHost(_lastHost);
|
cookie->setHost(_lastHost);
|
||||||
|
|
||||||
for(auto &pr : key_val){
|
int index = 0;
|
||||||
if(pr.first == "path"){
|
auto arg_vec = split(set_cookie, ";");
|
||||||
cookie->setPath(pr.second);
|
for (string &key_val : arg_vec) {
|
||||||
}else if(pr.first == "expires"){
|
auto key = FindField(key_val.data(),NULL,"=");
|
||||||
cookie->setExpires(pr.second);
|
auto val = FindField(key_val.data(),"=", NULL);
|
||||||
}else{
|
|
||||||
cookie->setKeyVal(pr.first,pr.second);
|
if(index++ == 0){
|
||||||
|
cookie->setKeyVal(key,val);
|
||||||
|
} else{
|
||||||
|
if(key == "path"){
|
||||||
|
cookie->setPath(val);
|
||||||
|
}else if(key == "expires"){
|
||||||
|
cookie->setExpires(val);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(*cookie)){
|
if(!(*cookie)){
|
||||||
//无效的cookie
|
//无效的cookie
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user