From 9fef8b06114e011cedab7c25fc6d44f9de99b2ab Mon Sep 17 00:00:00 2001 From: Kevin Morris Date: Sat, 30 Oct 2021 22:53:30 -0700 Subject: [PATCH] fix(rpc): fix search arg check When by == 'maintainer', we allow an unspecified keyword, resulting in a search of orphan packages. Fix our search check so that when no arg is given, it is set to an empty str(). We already check for valid args when type is not maintainer, so there's no need to worry about other args falling through. Signed-off-by: Kevin Morris --- aurweb/rpc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aurweb/rpc.py b/aurweb/rpc.py index 009b1440..16985f37 100644 --- a/aurweb/rpc.py +++ b/aurweb/rpc.py @@ -200,8 +200,8 @@ class RPC: if by != "m" and not len(args): raise RPCError("No request type/data specified.") - arg = args[0] - if len(arg) < 2: + arg = args[0] if args else str() + if by != "m" and len(arg) < 2: raise RPCError("Query arg too small.") search = RPCSearch()