Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving the error handling out of network loader... #8851

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Added 'about:sslfail' and a reftest for SSL failure

  • Loading branch information
wafflespeanut committed Feb 20, 2016
commit 5bec4d4ea2bf8bec5aec75d90d0aa818829dad4b
@@ -15,6 +15,13 @@ use std::sync::Arc;
use url::Url;
use util::resource_files::resources_dir_path;

fn url_from_non_relative_scheme(load_data: &mut LoadData, filename: &str) {
let mut path = resources_dir_path();
path.push(filename);
assert!(path.exists());
load_data.url = Url::from_file_path(&*path).unwrap();
}

pub fn factory(mut load_data: LoadData,
start_chan: LoadConsumer,
classifier: Arc<MIMEClassifier>,
@@ -41,13 +48,9 @@ pub fn factory(mut load_data: LoadData,
return
}
"crash" => panic!("Loading the about:crash URL."),
"failure" | "not-found" => {
let mut path = resources_dir_path();
let file_name = non_relative_scheme_data.to_owned() + ".html";
path.push(&file_name);
assert!(path.exists());
load_data.url = Url::from_file_path(&*path).unwrap();
}
"failure" | "not-found" =>
url_from_non_relative_scheme(&mut load_data, &(non_relative_scheme_data.to_owned() + ".html")),
"sslfail" => url_from_non_relative_scheme(&mut load_data, "badcert.html"),
_ => {
send_error(load_data.url, NetworkError::Internal("Unknown about: URL.".to_owned()), start_chan);
return
@@ -5380,6 +5380,18 @@
"url": "/_mozilla/mozilla/iframe/resize_after_load.html"
}
],
"mozilla/sslfail.html": [
{
"path": "mozilla/sslfail.html",
"references": [
[
"/_mozilla/mozilla/sslfail-ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/sslfail.html"
}
],
"mozilla/webgl/clearcolor.html": [
{
"path": "mozilla/webgl/clearcolor.html",
@@ -11538,6 +11550,18 @@
"url": "/_mozilla/mozilla/iframe/resize_after_load.html"
}
],
"mozilla/sslfail.html": [
{
"path": "mozilla/sslfail.html",
"references": [
[
"/_mozilla/mozilla/sslfail-ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/sslfail.html"
}
],
"mozilla/webgl/clearcolor.html": [
{
"path": "mozilla/webgl/clearcolor.html",
@@ -0,0 +1,9 @@
<html>
<head>
<meta charset=utf-8>
<title>SSL Failure Reference</title>
</head>
<body>
<iframe src="about:sslfail"></iframe>
</body>
</html>
@@ -0,0 +1,10 @@
<html>
<head>
<meta charset=utf-8>
<title>SSL Failure</title>
<link rel=match href=sslfail-ref.html>
</head>
<body>
<iframe src="https://somesite.org/blah"></iframe>
</body>
</html>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.