aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/net/resource_task.rs4
-rw-r--r--components/util/opts.rs6
-rw-r--r--resources/prefs.json1
3 files changed, 3 insertions, 8 deletions
diff --git a/components/net/resource_task.rs b/components/net/resource_task.rs
index b80f47255b9..572374d0d4e 100644
--- a/components/net/resource_task.rs
+++ b/components/net/resource_task.rs
@@ -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;
diff --git a/components/util/opts.rs b/components/util/opts.rs
index 03355e12a63..0b276e644e1 100644
--- a/components/util/opts.rs
+++ b/components/util/opts.rs
@@ -171,9 +171,6 @@ pub struct Opts {
/// Whether to show an error when display list geometry escapes flow overflow regions.
pub validate_display_list_geometry: bool,
- /// Whether MIME sniffing should be used
- pub sniff_mime_types: bool,
-
/// Whether Style Sharing Cache is used
pub disable_share_style_cache: bool,
@@ -491,7 +488,6 @@ pub fn default_opts() -> Opts {
profile_tasks: false,
profile_script_events: false,
profile_heartbeats: false,
- sniff_mime_types: false,
disable_share_style_cache: false,
parallel_display_list_building: false,
convert_mouse_to_touch: false,
@@ -536,7 +532,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
"A comma-separated string of debug options. Pass help to show available options.", "");
opts.optflag("h", "help", "Print this message");
opts.optopt("", "resources-path", "Path to find static resources", "/home/servo/resources");
- opts.optflag("", "sniff-mime-types" , "Enable MIME sniffing");
opts.optopt("", "content-process" , "Run as a content process and connect to the given pipe",
"servo-ipc-channel.abcdefg");
opts.optmulti("", "pref",
@@ -726,7 +721,6 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult {
dump_layer_tree: debug_options.dump_layer_tree,
relayout_event: debug_options.relayout_event,
validate_display_list_geometry: debug_options.validate_display_list_geometry,
- sniff_mime_types: opt_match.opt_present("sniff-mime-types"),
disable_share_style_cache: debug_options.disable_share_style_cache,
parallel_display_list_building: debug_options.parallel_display_list_building,
convert_mouse_to_touch: debug_options.convert_mouse_to_touch,
diff --git a/resources/prefs.json b/resources/prefs.json
index b1244343973..66f0e4cc824 100644
--- a/resources/prefs.json
+++ b/resources/prefs.json
@@ -10,5 +10,6 @@
"layout.text-orientation.enabled": false,
"layout.viewport.enabled": false,
"layout.writing-mode.enabled": false,
+ "net.mime.sniff": false,
"shell.homepage": "http://servo.org"
}