diff options
| author | Przemysław Suliga <mail@suligap.net> | 2018-06-22 11:21:52 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-06-29 10:17:52 -0400 |
| commit | d22b90b4eabc1fe9b7b35aada441e0edf5ebd6d8 (patch) | |
| tree | 9dcafc8e840de7fc1f2fc11aa818bfd2fd557557 /tests/utils_tests/test_http.py | |
| parent | b5dd6ef3d52544ec7533509915c61545d5c3d85a (diff) | |
Fixed #29525 -- Allowed is_safe_url()'s allowed_hosts arg to be a string.
Diffstat (limited to 'tests/utils_tests/test_http.py')
| -rw-r--r-- | tests/utils_tests/test_http.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/utils_tests/test_http.py b/tests/utils_tests/test_http.py index 86fcff9d8e..05b43c814f 100644 --- a/tests/utils_tests/test_http.py +++ b/tests/utils_tests/test_http.py @@ -165,6 +165,10 @@ class IsSafeURLTests(unittest.TestCase): # Basic auth without host is not allowed. self.assertIs(is_safe_url(r'http://testserver\@example.com', allowed_hosts=None), False) + def test_allowed_hosts_str(self): + self.assertIs(is_safe_url('http://good.com/good', allowed_hosts='good.com'), True) + self.assertIs(is_safe_url('http://good.co/evil', allowed_hosts='good.com'), False) + def test_secure_param_https_urls(self): secure_urls = ( 'https://example.com/p', |
