зеркало из https://github.com/mozilla/gecko-dev.git
Bug 26496 - Jar protocol fails silently on file-not-found. r=darin, sr=bz
This commit is contained in:
Родитель
fabdb4edc3
Коммит
833f88d123
|
@ -2949,7 +2949,16 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI *aURI,
|
|||
else if (NS_ERROR_FILE_NOT_FOUND == aError) {
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
nsCAutoString spec;
|
||||
aURI->GetPath(spec);
|
||||
// displaying "file://" is aesthetically unpleasing and could even be
|
||||
// confusing to the user
|
||||
PRBool isFileURI = PR_FALSE;
|
||||
rv = aURI->SchemeIs("file", &isFileURI);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (isFileURI)
|
||||
aURI->GetPath(spec);
|
||||
else
|
||||
aURI->GetSpec(spec);
|
||||
nsCAutoString charset;
|
||||
// unescape and convert from origin charset
|
||||
aURI->GetOriginCharset(charset);
|
||||
|
|
|
@ -163,7 +163,13 @@ nsJARInputThunk::EnsureJarStream()
|
|||
rv = mJarReader->GetInputStream(mJarEntry.get(),
|
||||
getter_AddRefs(mJarStream));
|
||||
}
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (NS_FAILED(rv)) {
|
||||
// convert to the proper result if the entry wasn't found
|
||||
// so that error pages work
|
||||
if (rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
|
||||
rv = NS_ERROR_FILE_NOT_FOUND;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// ask the JarStream for the content length
|
||||
mJarStream->Available((PRUint32 *) &mContentLength);
|
||||
|
|
Загрузка…
Ссылка в новой задаче