aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbors-servo <release+servo@mozilla.com>2014-04-18 21:55:13 -0400
committerbors-servo <release+servo@mozilla.com>2014-04-18 21:55:13 -0400
commit7d9fa356717839fdf1ab01ccbc83fa71eefaf426 (patch)
tree70f1456a36685664ba6978df2fd1ed7daa0ae7c6 /src
parent23e325ffb77092b6a108ab40bb2666067e673106 (diff)
parentc63ae6f11d11ccefbae7d0db8bc99feaa7bbd62a (diff)
downloadservo-7d9fa356717839fdf1ab01ccbc83fa71eefaf426.tar.gz
servo-7d9fa356717839fdf1ab01ccbc83fa71eefaf426.zip
auto merge of #2166 : campadrenalin/servo/https-dont-panic, r=jdm
This is a stab at #2401 - I think this was what @jdm had in mind for a fix. I've also included a test. There's no "i tried" star, I'm too much of a newb for that, but hopefully the test at least confirms that servo doesn't crash on HTTPS requests.
Diffstat (limited to 'src')
-rw-r--r--src/components/net/http_loader.rs6
-rw-r--r--src/test/html/https.html7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/components/net/http_loader.rs b/src/components/net/http_loader.rs
index 1bed5bf2e49..2b632a5d572 100644
--- a/src/components/net/http_loader.rs
+++ b/src/components/net/http_loader.rs
@@ -52,7 +52,11 @@ fn load(mut url: Url, start_chan: Sender<LoadResponse>) {
redirected_to.insert(url.clone());
- assert!("http" == url.scheme);
+ if "http" != url.scheme {
+ info!("{:s} request, but we don't support that scheme", url.scheme);
+ send_error(url, start_chan);
+ return;
+ }
info!("requesting {:s}", url.to_str());
diff --git a/src/test/html/https.html b/src/test/html/https.html
new file mode 100644
index 00000000000..c461f0c5e3d
--- /dev/null
+++ b/src/test/html/https.html
@@ -0,0 +1,7 @@
+<html>
+<head>
+</head>
+<body>
+<img src="https://some-site.org/some-image.png"/>
+</body>
+</html>