Skip to content

Commit

Permalink
Merge pull request #120 from epi052/fix-directory-extraction-bug
Browse files Browse the repository at this point in the history
Fix directory extraction bug
  • Loading branch information
epi052 authored Nov 11, 2020
2 parents c8775e3 + d63d7dc commit 20938dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "feroxbuster"
version = "1.5.2"
version = "1.5.3"
authors = ["Ben 'epi' Risher <[email protected]>"]
license = "MIT"
edition = "2018"
Expand Down
12 changes: 2 additions & 10 deletions src/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,9 @@ 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
Expand Down Expand Up @@ -855,7 +847,7 @@ mod tests {
assert_eq!(
urls.write()
.unwrap()
.insert("http://unknown_url/".to_string()),
.insert("http://unknown_url".to_string()),
true
);

Expand Down

0 comments on commit 20938dd

Please sign in to comment.