mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Added 'about:sslfail' and a reftest for SSL failure
This commit is contained in:
parent
945a2c66e1
commit
16096f1a9c
4 changed files with 53 additions and 7 deletions
|
@ -15,6 +15,13 @@ use std::sync::Arc;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
use util::resource_files::resources_dir_path;
|
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,
|
pub fn factory(mut load_data: LoadData,
|
||||||
start_chan: LoadConsumer,
|
start_chan: LoadConsumer,
|
||||||
classifier: Arc<MIMEClassifier>,
|
classifier: Arc<MIMEClassifier>,
|
||||||
|
@ -41,13 +48,9 @@ pub fn factory(mut load_data: LoadData,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
"crash" => panic!("Loading the about:crash URL."),
|
"crash" => panic!("Loading the about:crash URL."),
|
||||||
"failure" | "not-found" => {
|
"failure" | "not-found" =>
|
||||||
let mut path = resources_dir_path();
|
url_from_non_relative_scheme(&mut load_data, &(non_relative_scheme_data.to_owned() + ".html")),
|
||||||
let file_name = non_relative_scheme_data.to_owned() + ".html";
|
"sslfail" => url_from_non_relative_scheme(&mut load_data, "badcert.html"),
|
||||||
path.push(&file_name);
|
|
||||||
assert!(path.exists());
|
|
||||||
load_data.url = Url::from_file_path(&*path).unwrap();
|
|
||||||
}
|
|
||||||
_ => {
|
_ => {
|
||||||
send_error(load_data.url, NetworkError::Internal("Unknown about: URL.".to_owned()), start_chan);
|
send_error(load_data.url, NetworkError::Internal("Unknown about: URL.".to_owned()), start_chan);
|
||||||
return
|
return
|
||||||
|
|
|
@ -5779,6 +5779,18 @@
|
||||||
"url": "/_mozilla/mozilla/iframe/resize_after_load.html"
|
"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": [
|
"mozilla/webgl/clearcolor.html": [
|
||||||
{
|
{
|
||||||
"path": "mozilla/webgl/clearcolor.html",
|
"path": "mozilla/webgl/clearcolor.html",
|
||||||
|
@ -12441,6 +12453,18 @@
|
||||||
"url": "/_mozilla/mozilla/iframe/resize_after_load.html"
|
"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": [
|
"mozilla/webgl/clearcolor.html": [
|
||||||
{
|
{
|
||||||
"path": "mozilla/webgl/clearcolor.html",
|
"path": "mozilla/webgl/clearcolor.html",
|
||||||
|
|
9
tests/wpt/mozilla/tests/mozilla/sslfail-ref.html
Normal file
9
tests/wpt/mozilla/tests/mozilla/sslfail-ref.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset=utf-8>
|
||||||
|
<title>SSL Failure Reference</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<iframe src="about:sslfail"></iframe>
|
||||||
|
</body>
|
||||||
|
</html>
|
10
tests/wpt/mozilla/tests/mozilla/sslfail.html
Normal file
10
tests/wpt/mozilla/tests/mozilla/sslfail.html
Normal file
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue