auto merge of #5312 : frewsxcv/servo/cleanup-view-source, r=jdm

Fixes #5304
This commit is contained in:
bors-servo 2015-03-23 15:42:48 -06:00
commit 0c3615ced1

View file

@ -64,7 +64,8 @@ fn load(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>, cooki
// real URL that should be used for which the source is to be viewed. // real URL that should be used for which the source is to be viewed.
// Change our existing URL to that and keep note that we are viewing // Change our existing URL to that and keep note that we are viewing
// the source rather than rendering the contents of the URL. // the source rather than rendering the contents of the URL.
let viewing_source = if &*url.scheme == "view-source" { let viewing_source = url.scheme == "view-source";
if viewing_source {
let inner_url = load_data.url.non_relative_scheme_data().unwrap(); let inner_url = load_data.url.non_relative_scheme_data().unwrap();
url = Url::parse(inner_url).unwrap(); url = Url::parse(inner_url).unwrap();
match &*url.scheme { match &*url.scheme {
@ -75,10 +76,7 @@ fn load(mut load_data: LoadData, start_chan: Sender<TargetedLoadResponse>, cooki
return; return;
} }
}; };
true }
} else {
false
};
// Loop to handle redirects. // Loop to handle redirects.
loop { loop {