Skip to content

Commit

Permalink
misc: small fix or general refactoring i did not bother commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Feb 15, 2024
1 parent ccf2361 commit f06e3f9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/plugins/tcp_ports/grabbers/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ pub(crate) async fn http_grabber(
// collect info from html
let body = resp.text().await;
if let Ok(body) = body {
if content_type == "text/html" {
if content_type.contains("text/html") {
if let Some(caps) = HTML_TITLE_PARSER.captures(&body) {
banner.insert(
"html.title".to_owned(),
caps.get(1).unwrap().as_str().to_owned(),
);
}
} else if content_type.starts_with("application/") || content_type.starts_with("text/")
{
} else if content_type.contains("application/") || content_type.contains("text/") {
banner.insert("body".to_owned(), body.to_owned());
}
} else {
Expand Down

0 comments on commit f06e3f9

Please sign in to comment.