mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Rust: Remove unused function in XSS tests
This commit is contained in:
@@ -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 {
|
||||
'<' => "<".to_string(),
|
||||
'>' => ">".to_string(),
|
||||
'&' => "&".to_string(),
|
||||
'"' => """.to_string(),
|
||||
'\'' => "'".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 {
|
||||
|
||||
Reference in New Issue
Block a user