mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-06-01 04:41:12 -03:00
changed follow_redirects to redirects
This commit is contained in:
@@ -60,7 +60,7 @@ verbosity = 1
|
||||
quiet = true
|
||||
verbosity = 1
|
||||
output = "/some/output/file/path"
|
||||
follow_redirects = true
|
||||
redirects = true
|
||||
insecure = true
|
||||
extensions = ["php", "html"]
|
||||
headers = {"Accept" = "application/json"}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
# quiet = true
|
||||
# output = "/targets/ellingson_mineral_company/gibson.txt"
|
||||
# useragent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0"
|
||||
# follow_redirects = true
|
||||
# redirects = true
|
||||
# insecure = true
|
||||
# extensions = ["php", "html"]
|
||||
# norecursion = true
|
||||
|
||||
@@ -8,13 +8,13 @@ use std::time::Duration;
|
||||
pub fn initialize(
|
||||
timeout: u64,
|
||||
useragent: &str,
|
||||
follow_redirects: bool,
|
||||
redirects: bool,
|
||||
insecure: bool,
|
||||
headers: &HashMap<String, String>,
|
||||
proxy: Option<&str>,
|
||||
) -> Client {
|
||||
// todo: integration test for this as well, specifically redirect, timeout, proxy, etc
|
||||
let policy = if follow_redirects {
|
||||
let policy = if redirects {
|
||||
Policy::limited(10)
|
||||
} else {
|
||||
Policy::none()
|
||||
|
||||
@@ -47,7 +47,7 @@ pub struct Configuration {
|
||||
#[serde(default = "useragent")]
|
||||
pub useragent: String,
|
||||
#[serde(default)]
|
||||
pub follow_redirects: bool,
|
||||
pub redirects: bool,
|
||||
#[serde(default)]
|
||||
pub insecure: bool,
|
||||
#[serde(default)]
|
||||
@@ -97,7 +97,7 @@ impl Default for Configuration {
|
||||
addslash: false,
|
||||
insecure: false,
|
||||
norecursion: false,
|
||||
follow_redirects: false,
|
||||
redirects: false,
|
||||
proxy: String::new(),
|
||||
output: String::new(),
|
||||
target_url: String::new(),
|
||||
@@ -115,7 +115,7 @@ impl Configuration {
|
||||
/// built-in default values
|
||||
///
|
||||
/// - timeout: 5 seconds
|
||||
/// - follow_redirects: false
|
||||
/// - redirects: false
|
||||
/// - wordlist: [`DEFAULT_WORDLIST`](constant.DEFAULT_WORDLIST.html)
|
||||
/// - threads: 50
|
||||
/// - timeout: 7
|
||||
@@ -160,7 +160,7 @@ impl Configuration {
|
||||
config.quiet = settings.quiet;
|
||||
config.output = settings.output;
|
||||
config.useragent = settings.useragent;
|
||||
config.follow_redirects = settings.follow_redirects;
|
||||
config.redirects = settings.redirects;
|
||||
config.insecure = settings.insecure;
|
||||
config.extensions = settings.extensions;
|
||||
config.headers = settings.headers;
|
||||
@@ -250,8 +250,8 @@ impl Configuration {
|
||||
config.timeout = timeout;
|
||||
}
|
||||
|
||||
if args.is_present("follow_redirects") {
|
||||
config.follow_redirects = args.is_present("follow_redirects");
|
||||
if args.is_present("redirects") {
|
||||
config.redirects = args.is_present("redirects");
|
||||
}
|
||||
|
||||
if args.is_present("insecure") {
|
||||
@@ -273,7 +273,7 @@ impl Configuration {
|
||||
if !config.proxy.is_empty()
|
||||
|| config.timeout != timeout()
|
||||
|| config.useragent != useragent()
|
||||
|| config.follow_redirects
|
||||
|| config.redirects
|
||||
|| config.insecure
|
||||
|| config.headers.len() > 0
|
||||
{
|
||||
@@ -281,7 +281,7 @@ impl Configuration {
|
||||
config.client = client::initialize(
|
||||
config.timeout,
|
||||
&config.useragent,
|
||||
config.follow_redirects,
|
||||
config.redirects,
|
||||
config.insecure,
|
||||
&config.headers,
|
||||
None,
|
||||
@@ -290,7 +290,7 @@ impl Configuration {
|
||||
config.client = client::initialize(
|
||||
config.timeout,
|
||||
&config.useragent,
|
||||
config.follow_redirects,
|
||||
config.redirects,
|
||||
config.insecure,
|
||||
&config.headers,
|
||||
Some(&config.proxy),
|
||||
@@ -336,7 +336,7 @@ mod tests {
|
||||
quiet = true
|
||||
verbosity = 1
|
||||
output = "/some/otherpath"
|
||||
follow_redirects = true
|
||||
redirects = true
|
||||
insecure = true
|
||||
extensions = ["html", "php", "js"]
|
||||
headers = {stuff = "things", mostuff = "mothings"}
|
||||
@@ -362,7 +362,7 @@ mod tests {
|
||||
assert_eq!(config.quiet, false);
|
||||
assert_eq!(config.norecursion, false);
|
||||
assert_eq!(config.addslash, false);
|
||||
assert_eq!(config.follow_redirects, false);
|
||||
assert_eq!(config.redirects, false);
|
||||
assert_eq!(config.insecure, false);
|
||||
assert_eq!(config.extensions, Vec::<String>::new());
|
||||
assert_eq!(config.headers, HashMap::new());
|
||||
@@ -417,9 +417,9 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_reads_follow_redirects() {
|
||||
fn config_reads_redirects() {
|
||||
let config = setup_config_test();
|
||||
assert_eq!(config.follow_redirects, true);
|
||||
assert_eq!(config.redirects, true);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -93,9 +93,9 @@ pub fn initialize() -> App<'static, 'static> {
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("follow_redirects")
|
||||
Arg::with_name("redirects")
|
||||
.short("r")
|
||||
.long("follow_redirects")
|
||||
.long("redirects")
|
||||
.takes_value(false)
|
||||
.help("Follow redirects (default: false)")
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user