aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-02-15 11:49:58 -0600
committerJP Dillingham <jp@dillingham.me>2026-02-15 11:49:58 -0600
commit7d20188935802375275ca4db3398072115ddd6e9 (patch)
tree86251b9db98ae2b9f2af36285508e2b0f1f256c3 /src
parent46f76b61d2afb509ce0c891fa36f2ac9388696bd (diff)
downloadslskd-7d20188935802375275ca4db3398072115ddd6e9.tar.gz
use ModelState.IsValid
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Search/API/Controllers/SearchesController.cs4
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))