From c06784644c4b06206958b5f10498ce517a7b60ba Mon Sep 17 00:00:00 2001 From: nggit <12218311+nggit@users.noreply.github.com> Date: Thu, 14 Nov 2024 08:26:03 +0700 Subject: [PATCH] clean up tests --- tests/test_http.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_http.py b/tests/test_http.py index 69ed170..77a148b 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -259,18 +259,17 @@ def test_sec_unsafe_chars_percent(self): ) self.assertEqual(body, b'Unsafe URL detected') - def test_sec_unsafe_chars_null(self): + def test_sec_unsafe_chars_nul(self): header, body = getcontents(host=HTTP_HOST, port=HTTP_PORT, method='GET', url='/example.php\x00.png', version='1.1') - self.assertEqual( - header[:header.find(b'\r\n')], - b'HTTP/1.1 403 Forbidden' - ) - self.assertEqual(body, b'Unsafe URL detected') + # NUL is already handled by upstream + # currently the response is empty + self.assertEqual(header, b'') + self.assertEqual(body, b'') def test_disallowed_ext(self): header, body = getcontents(host=HTTP_HOST,