diff --git a/CHANGELOG.md b/CHANGELOG.md index cc1367bb..85356c60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log +## [2024.7.22] - 2024.7.22 + +### Fixes + +- 如果没有协议默认尝试https和http + ## [2024.7.20] - 2024.7.20 ### Fixes diff --git a/observer_ward/src/lib.rs b/observer_ward/src/lib.rs index 963e428b..99bff40c 100644 --- a/observer_ward/src/lib.rs +++ b/observer_ward/src/lib.rs @@ -10,7 +10,7 @@ use engine::matchers::FaviconMap; use engine::request::RequestGenerator; use engine::results::{FingerprintResult, NucleiResult}; use engine::slinger::http::header::HeaderValue; -use engine::slinger::http::uri::Uri; +use engine::slinger::http::uri::{PathAndQuery, Uri}; use engine::slinger::http::StatusCode; use engine::slinger::redirect::{only_same_host, Policy}; use engine::slinger::{http_serde, Request, Response}; @@ -334,7 +334,23 @@ fn input_to_byte(payload: &str) -> Vec { } buf } - +fn set_uri_scheme(scheme: &str, target: &Uri) -> Result { + Uri::builder() + .scheme(scheme) + .authority( + target + .authority() + .map_or(target.host().unwrap_or_default(), |a| a.as_str()), + ) + .path_and_query( + target + .path_and_query() + .unwrap_or(&PathAndQuery::from_static("/")) + .as_str(), + ) + .build() + .map_err(|e| new_io_error(&e.to_string())) +} pub fn parse_yaml(yaml_path: &PathBuf) -> Result