Ajout de la vérification de la taille
Rust Checks / checks (push) Successful in 19s Details
Rust Checks / checks (pull_request) Successful in 19s Details

This commit is contained in:
Tipragot 2024-01-10 15:09:09 +01:00
parent 0fae1f39d4
commit 6ff765ca54
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ async fn register_score(
// Vérification du nom du joueur
let authorized_characters = "abcdefghijklmnopqrstuvwxyz0123456789_-";
if name.chars().any(|c| !authorized_characters.contains(c)) {
if name.len() > 16 || name.chars().any(|c| !authorized_characters.contains(c)) {
return StatusCode::BAD_REQUEST;
}