Resolve relative URLs that begin with '//'

This commit is contained in:
Patrick Walton 2013-06-09 17:37:29 -07:00
parent a9ed2d809d
commit e50cee9adc
3 changed files with 7 additions and 2 deletions

View file

@ -129,11 +129,13 @@ fn js_script_listener(to_parent: Chan<~[~[u8]]>,
buf += data;
}
Done(Ok(*)) => {
result_chan.send(buf);
result_chan.send(Some(buf));
break;
}
Done(Err(*)) => {
error!("error loading script %s", url.to_str());
result_chan.send(None);
break;
}
}
}
@ -146,7 +148,7 @@ fn js_script_listener(to_parent: Chan<~[~[u8]]>,
}
}
let js_scripts = vec::map(result_vec, |result_port| result_port.recv());
let js_scripts = vec::filter_map(result_vec, |result_port| result_port.recv());
to_parent.send(js_scripts);
}