Rust: Remove unused function in XSS tests

This commit is contained in:
Simon Friis Vindum
2025-11-25 17:20:54 +01:00
parent 7c7663629e
commit 7278bc75ca

View File

@@ -25,19 +25,6 @@ async fn vulnerable_handler(path: web::Path<String>) -> impl Responder {
Html::new(html) // $ Alert[rust/xss]=a
}
fn html_escape(s: &str) -> String {
s.chars()
.map(|c| match c {
'<' => "&lt;".to_string(),
'>' => "&gt;".to_string(),
'&' => "&amp;".to_string(),
'"' => "&quot;".to_string(),
'\'' => "&#x27;".to_string(),
_ => c.to_string(),
})
.collect()
}
#[get("/good/{a}")]
// The "good" example from the qldoc
async fn safe_handler_with_encoding(path: web::Path<String>) -> impl Responder {