mirror of
https://github.com/zedeus/nitter.git
synced 2025-12-10 05:55:37 -05:00
Limit search length
This commit is contained in:
@@ -14,6 +14,9 @@ proc createSearchRouter*(cfg: Config) =
|
||||
if @"text".len == 0 or "." in @"text":
|
||||
resp Http404, showError("Please enter a valid username.", cfg.title)
|
||||
|
||||
if @"text".len > 200:
|
||||
resp Http400, showError("Search input too long.", cfg.title)
|
||||
|
||||
if "," in @"text":
|
||||
redirect("/" & @"text")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user