For HTTP redirect, inherit the origin charset of the current uri for a new uri.

patch by darin,
bug 161174, r=nhotta, sr=bzbarsky.
This commit is contained in:
nhotta%netscape.com 2002-08-15 01:16:33 +00:00
Родитель 8a0670b9ed
Коммит 315aee0b5d
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -1470,7 +1470,13 @@ nsHttpChannel::ProcessRedirection(PRUint32 redirectType)
nsCOMPtr<nsIIOService> ioService;
rv = nsHttpHandler::get()->GetIOService(getter_AddRefs(ioService));
rv = ioService->NewURI(nsDependentCString(location), nsnull, mURI,
// the new uri should inherit the origin charset of the current uri
nsCAutoString originCharset;
rv = mURI->GetOriginCharset(originCharset);
if (NS_FAILED(rv))
originCharset.Truncate();
rv = ioService->NewURI(nsDependentCString(location), originCharset.get(), mURI,
getter_AddRefs(newURI));
if (NS_FAILED(rv)) return rv;