Ajout de la vérification de la taille des noms (#6)
Rust Checks / checks (push) Successful in 20s Details

Reviewed-on: #6
Reviewed-by: Corentin <solois.corentin@gmail.com>
Co-authored-by: Tipragot <contact@tipragot.fr>
Co-committed-by: Tipragot <contact@tipragot.fr>
This commit is contained in:
Tipragot 2024-01-10 18:48:38 +00:00 committed by Corentin
parent 0fae1f39d4
commit 98204bc6be
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;
}