From c60f678485b986172b56a6367a581bb6d7668865 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Tue, 22 Mar 2022 01:58:56 +0100 Subject: [PATCH] Tests: Added tests for empty "location". --- test/test_return.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/test_return.py b/test/test_return.py index ff2e4566..82bf1e64 100644 --- a/test/test_return.py +++ b/test/test_return.py @@ -178,6 +178,21 @@ Connection: close == "/#%23foo%3Fbar" ), 'location with a variable with encoding' + assert 'success' in self.conf( + '""', 'routes/0/action/location' + ), 'location empty' + assert self.get()['headers']['Location'] == '' + + assert 'success' in self.conf( + '"${host}"', 'routes/0/action/location' + ), 'location empty with variable' + assert ( + self.get(headers={"Host": "", "Connection": "close"})['headers'][ + 'Location' + ] + == "" + ), 'location with empty variable' + def test_return_invalid(self): def check_error(conf): assert 'error' in self.conf(conf, 'routes/0/action')