mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Correct implementation of the ability to observe and modify resource redirects (issue #346).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@419 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -220,6 +220,23 @@ public:
|
||||
location->Swap(&redirect_url_);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (response_.get()) {
|
||||
// Check for HTTP 302 or HTTP 303 redirect.
|
||||
int status = response_->GetStatus();
|
||||
if (status == 302 || status == 303) {
|
||||
CefResponse::HeaderMap headerMap;
|
||||
response_->GetHeaderMap(headerMap);
|
||||
CefRequest::HeaderMap::iterator iter = headerMap.find("Location");
|
||||
if(iter != headerMap.end()) {
|
||||
GURL new_url = GURL(std::string(iter->second));
|
||||
*http_status_code = status;
|
||||
location->Swap(&new_url);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user