diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-29 19:34:59 -0500 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2023-01-29 19:34:59 -0500 |
commit | 8af75aef1754b4c2ce67a917182acc732051fc01 (patch) | |
tree | f64306919ae7fecb1a0cfb65415e5836f78209fc /src/console.rs | |
parent | admin page (diff) | |
download | xssbook-8af75aef1754b4c2ce67a917182acc732051fc01.tar.gz xssbook-8af75aef1754b4c2ce67a917182acc732051fc01.tar.bz2 xssbook-8af75aef1754b4c2ce67a917182acc732051fc01.zip |
refactor
Diffstat (limited to 'src/console.rs')
-rw-r--r-- | src/console.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/console.rs b/src/console.rs index 6e2649f..4148ded 100644 --- a/src/console.rs +++ b/src/console.rs @@ -46,7 +46,6 @@ lazy_static! { } pub async fn log(ip: IpAddr, method: Method, uri: Uri, path: Option<String>, body: Option<String>) { - let path = path.unwrap_or_default(); let body = body.unwrap_or_default(); @@ -202,11 +201,13 @@ impl Formatter for HtmlFormatter { } pub fn sanatize(input: String) -> String { - input.replace("&", "&").replace("<", "<").replace(">", ">") + input + .replace('&', "&") + .replace('<', "<") + .replace('>', ">") } pub fn beautify(body: String) -> String { - let body = sanatize(body); if body.is_empty() { |