Bug 738484 - Handle Location: that won't parse to valid URI. r=mcmanus

This commit is contained in:
Jason Duell 2012-04-11 13:26:23 -07:00
Родитель 5902f3f119
Коммит ddb657b32d
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -1149,6 +1149,11 @@ nsHttpChannel::ProcessResponse()
nsresult
nsHttpChannel::ContinueProcessResponse(nsresult rv)
{
if (rv == NS_ERROR_CORRUPTED_CONTENT) {
// don't ever render responses we've flagged as suspect content
return NS_ERROR_CORRUPTED_CONTENT;
}
if (rv == NS_ERROR_DOM_BAD_URI && mRedirectURI) {
bool isHTTP = false;
@ -3526,7 +3531,11 @@ nsHttpChannel::AsyncProcessRedirection(PRUint32 redirectType)
nsresult rv = CreateNewURI(location, getter_AddRefs(mRedirectURI));
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) {
LOG(("Invalid URI for redirect: Location: %s\n", location));
Cancel(NS_ERROR_CORRUPTED_CONTENT);
return NS_ERROR_CORRUPTED_CONTENT;
}
if (mApplicationCache) {
// if we are redirected to a different origin check if there is a fallback