mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Consistently use content-type sniffing with all protocols.
This commit is contained in:
parent
53d8f04ac4
commit
aef06f2f20
5 changed files with 44 additions and 38 deletions
|
@ -17,11 +17,14 @@ fn assert_parse(url: &'static str,
|
|||
charset: Option<String>,
|
||||
data: Option<Vec<u8>>) {
|
||||
use net::data_loader::load;
|
||||
use net::mime_classifier::MIMEClassifier;
|
||||
use std::sync::Arc;
|
||||
use std::sync::mpsc::channel;
|
||||
use url::Url;
|
||||
|
||||
let (start_chan, start_port) = ipc::channel().unwrap();
|
||||
load(LoadData::new(Url::parse(url).unwrap(), None), Channel(start_chan));
|
||||
let classifier = Arc::new(MIMEClassifier::new());
|
||||
load(LoadData::new(Url::parse(url).unwrap(), None), Channel(start_chan), classifier);
|
||||
|
||||
let response = start_port.recv().unwrap();
|
||||
assert_eq!(&response.metadata.content_type, &content_type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue