Skip to content

Commit 7278bc7

Browse files
committed
Rust: Remove unused function in XSS tests
1 parent 7c76636 commit 7278bc7

File tree

1 file changed

+0
-13
lines changed
  • rust/ql/test/query-tests/security/CWE-079/actix

1 file changed

+0
-13
lines changed

rust/ql/test/query-tests/security/CWE-079/actix/main.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,6 @@ async fn vulnerable_handler(path: web::Path<String>) -> impl Responder {
2525
Html::new(html) // $ Alert[rust/xss]=a
2626
}
2727

28-
fn html_escape(s: &str) -> String {
29-
s.chars()
30-
.map(|c| match c {
31-
'<' => "&lt;".to_string(),
32-
'>' => "&gt;".to_string(),
33-
'&' => "&amp;".to_string(),
34-
'"' => "&quot;".to_string(),
35-
'\'' => "&#x27;".to_string(),
36-
_ => c.to_string(),
37-
})
38-
.collect()
39-
}
40-
4128
#[get("/good/{a}")]
4229
// The "good" example from the qldoc
4330
async fn safe_handler_with_encoding(path: web::Path<String>) -> impl Responder {

0 commit comments

Comments
 (0)