diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-02-15 11:49:58 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-02-15 11:49:58 -0600 |
| commit | 7d20188935802375275ca4db3398072115ddd6e9 (patch) | |
| tree | 86251b9db98ae2b9f2af36285508e2b0f1f256c3 /src/slskd/Search/API/Controllers/SearchesController.cs | |
| parent | 46f76b61d2afb509ce0c891fa36f2ac9388696bd (diff) | |
| download | slskd-7d20188935802375275ca4db3398072115ddd6e9.tar.gz | |
use ModelState.IsValid
Diffstat (limited to 'src/slskd/Search/API/Controllers/SearchesController.cs')
| -rw-r--r-- | src/slskd/Search/API/Controllers/SearchesController.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/slskd/Search/API/Controllers/SearchesController.cs b/src/slskd/Search/API/Controllers/SearchesController.cs index fb25a866..06ff4908 100644 --- a/src/slskd/Search/API/Controllers/SearchesController.cs +++ b/src/slskd/Search/API/Controllers/SearchesController.cs @@ -71,9 +71,9 @@ namespace slskd.Search.API return Forbid(); } - if (string.IsNullOrWhiteSpace(request.SearchText)) + if (!ModelState.IsValid) { - return BadRequest("SearchText may not be null or empty"); + return BadRequest(ModelState.GetReadableString()); } if (!SearchRequestLimiter.Wait(0)) |
