Enable MIME sniffing via a pref instead of a global option.

This commit is contained in:
Josh Matthews 2015-10-25 11:50:13 -04:00
parent 9601d555cd
commit cca25e2b3a
3 changed files with 3 additions and 8 deletions

View file

@ -29,7 +29,7 @@ use std::collections::HashMap;
use std::sync::mpsc::{Receiver, Sender, channel};
use std::sync::{Arc, RwLock};
use url::Url;
use util::opts;
use util::prefs;
use util::task::spawn_named;
use websocket_loader;
@ -77,7 +77,7 @@ pub fn start_sending_sniffed_opt(start_chan: LoadConsumer, mut metadata: Metadat
classifier: Arc<MIMEClassifier>, partial_body: &[u8],
context: LoadContext)
-> Result<ProgressSender, ()> {
if opts::get().sniff_mime_types {
if prefs::get_pref("net.mime.sniff").as_boolean().unwrap_or(false) {
// TODO: should be calculated in the resource loader, from pull requeset #4094
let mut no_sniff = NoSniffFlag::OFF;
let mut check_for_apache_bug = ApacheBugFlag::OFF;