Add pref for HTTP redirection limit.

The pref key name matches the associated Gecko pref key name.
This commit is contained in:
Corey Farwell 2016-04-17 16:43:55 -04:00
parent 07209c75db
commit 8e14cbccc3
2 changed files with 3 additions and 4 deletions

View file

@ -44,6 +44,7 @@ use time::Tm;
#[cfg(any(target_os = "macos", target_os = "linux"))]
use tinyfiledialogs;
use url::Url;
use util::prefs;
use util::resource_files::resources_dir_path;
use util::thread::spawn_named;
use uuid;
@ -726,10 +727,7 @@ pub fn load<A, B>(load_data: LoadData,
user_agent: String,
cancel_listener: &CancellationListener)
-> Result<StreamedResponse<A::R>, LoadError> where A: HttpRequest + 'static, B: UIProvider {
// FIXME: At the time of writing this FIXME, servo didn't have any central
// location for configuration. If you're reading this and such a
// repository DOES exist, please update this constant to use it.
let max_redirects = 50;
let max_redirects = prefs::get_pref("network.http.redirection-limit").as_i64().unwrap() as u32;
let mut iters = 0;
// URL of the document being loaded, as seen by all the higher-level code.
let mut doc_url = load_data.url.clone();

View file

@ -49,6 +49,7 @@
"layout.text-orientation.enabled": false,
"layout.viewport.enabled": false,
"layout.writing-mode.enabled": false,
"network.http.redirection-limit": 50,
"network.mime.sniff": false,
"shell.native-titlebar.enabled": true,
"shell.homepage": "http://servo.org"