mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Resolves #4183 - Implemementing context-based MIME type sniffing
The version of the standard is not finalized at the time of this writing. Specifications may be found here: https://mimesniff.spec.whatwg.org/#context-specific-sniffing .
This commit is contained in:
parent
66c8aa8cda
commit
1e81b8c133
18 changed files with 226 additions and 93 deletions
|
@ -6,8 +6,8 @@ extern crate hyper;
|
|||
|
||||
use ipc_channel::ipc;
|
||||
use net_traits::LoadConsumer::Channel;
|
||||
use net_traits::LoadData;
|
||||
use net_traits::ProgressMsg::{Payload, Done};
|
||||
use net_traits::{LoadData, LoadContext};
|
||||
use self::hyper::header::ContentType;
|
||||
use self::hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value};
|
||||
|
||||
|
@ -25,7 +25,7 @@ fn assert_parse(url: &'static str,
|
|||
|
||||
let (start_chan, start_port) = ipc::channel().unwrap();
|
||||
let classifier = Arc::new(MIMEClassifier::new());
|
||||
load(LoadData::new(Url::parse(url).unwrap(), None),
|
||||
load(LoadData::new(LoadContext::Browsing, Url::parse(url).unwrap(), None),
|
||||
Channel(start_chan),
|
||||
classifier, CancellationListener::new(None));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue