mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-05-29 10:31:12 -03:00
fixed bug found by flangyver
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "feroxbuster"
|
||||
version = "1.5.2"
|
||||
version = "1.5.3"
|
||||
authors = ["Ben 'epi' Risher <epibar052@gmail.com>"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
||||
@@ -130,17 +130,10 @@ fn add_url_to_list_of_scanned_urls(resp: &str, scanned_urls: &RwLock<HashSet<Str
|
||||
match scanned_urls.write() {
|
||||
// check new url against what's already been scanned
|
||||
Ok(mut urls) => {
|
||||
let normalized_url = if resp.ends_with('/') {
|
||||
// append a / to the list of 'seen' urls, this is to prevent the case where
|
||||
// 3xx and 2xx duplicate eachother
|
||||
resp.to_string()
|
||||
} else {
|
||||
format!("{}/", resp)
|
||||
};
|
||||
|
||||
// If the set did not contain resp, true is returned.
|
||||
// If the set did contain resp, false is returned.
|
||||
let response = urls.insert(normalized_url);
|
||||
let response = urls.insert(resp.to_string());
|
||||
|
||||
log::trace!("exit: add_url_to_list_of_scanned_urls -> {}", response);
|
||||
response
|
||||
@@ -855,7 +848,7 @@ mod tests {
|
||||
assert_eq!(
|
||||
urls.write()
|
||||
.unwrap()
|
||||
.insert("http://unknown_url/".to_string()),
|
||||
.insert("http://unknown_url".to_string()),
|
||||
true
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user