use crate::{HostTarget, Protocol, ServiceTarget, Target, WebAssetTarget};
use std::net::{IpAddr, Ipv4Addr};
#[must_use]
#[allow(clippy::expect_used)]
pub fn web_target(url: &str) -> Target {
Target::Web(Box::new(WebAssetTarget {
url: url::Url::parse(url).expect("test web_target: invalid URL"),
service: ServiceTarget {
host: HostTarget {
ip: IpAddr::V4(Ipv4Addr::LOCALHOST),
domain: Some("example.com".to_string()),
},
port: 80,
protocol: Protocol::Tcp,
banner: None,
tls: false,
},
tech: vec![],
status: 200,
title: None,
favicon_hash: None,
body_hash: None,
forms: vec![],
params: vec![],
}))
}