File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/plugins/tcp_ports/grabbers Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -104,11 +104,15 @@ pub(crate) async fn http_grabber(
104
104
// collect headers
105
105
for ( name, value) in resp. headers ( ) {
106
106
let name = name. to_string ( ) ;
107
- let value = value. to_str ( ) . unwrap ( ) ;
107
+ let mut value = value. to_str ( ) . unwrap ( ) ;
108
108
109
109
if name == "content-type" {
110
+ if value. contains ( ';' ) {
111
+ value = value. split ( ';' ) . next ( ) . unwrap ( ) ;
112
+ }
110
113
content_type = value. to_owned ( ) ;
111
114
}
115
+
112
116
if headers_of_interest. contains ( & name. as_str ( ) ) {
113
117
banner. insert ( name, value. to_owned ( ) ) ;
114
118
}
@@ -121,7 +125,7 @@ pub(crate) async fn http_grabber(
121
125
if let Some ( caps) = HTML_TITLE_PARSER . captures ( & body) {
122
126
banner. insert (
123
127
"html.title" . to_owned ( ) ,
124
- caps. get ( 1 ) . unwrap ( ) . as_str ( ) . to_owned ( ) ,
128
+ caps. get ( 1 ) . unwrap ( ) . as_str ( ) . trim ( ) . to_owned ( ) ,
125
129
) ;
126
130
}
127
131
} else if content_type. contains ( "application/" ) || content_type. contains ( "text/" ) {
You can’t perform that action at this time.
0 commit comments