From 47c41cab06b48660b5ca16bbc73705055c40db37 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 19 Apr 2020 00:35:54 +0000 Subject: [PATCH] Fix port format validation --- yunodiagnoser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yunodiagnoser.py b/yunodiagnoser.py index cbdf49d..d50d1eb 100644 --- a/yunodiagnoser.py +++ b/yunodiagnoser.py @@ -264,7 +264,7 @@ async def check_ports(request): def is_port_number(p): return isinstance(p, int) and p > 0 and p < 65535 - assert all(not is_port_number(p) for p in data["ports"]), "'ports' should a list of valid port numbers" + assert all(is_port_number(p) for p in data["ports"]), "'ports' should a list of valid port numbers" except AssertionError as e: logger.info(f"Invalid request: {e} ... Original request body was: {request.body}") return json_response({