Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nggit committed Nov 14, 2024
1 parent 47ba97d commit c067846
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit c067846

Please sign in to comment.