From d68322bdab4c90e4a887300cd1460f286e34d565 Mon Sep 17 00:00:00 2001 From: UltraQbik Date: Tue, 20 Aug 2024 02:21:57 +0300 Subject: Path length check --- main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index deb3f74..4078d99 100644 --- a/main.py +++ b/main.py @@ -173,13 +173,18 @@ class HTMLServer: self.clients.remove(client) async def handle_get_request(self, client: socket.socket, req: dict[str, str | None]): + # check if the path is too long + if len(req["path"]) > 255: + response = get_response(400) + data = b'' + # if it's yandex - if req.get("from") == "support@search.yandex.ru": + elif req.get("from") == "support@search.yandex.ru": response = get_response(404) data = b'Nothing...' # check UwU path - elif req["path"] == "/UwU" or req["path"] == "/U/w/U": + elif req["path"] == "/UwU": response = get_response(6969) data = b'

' + b'UwU ' * 2000 + b'

' -- cgit 1.4.1