diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2018-07-11 19:35:36 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2018-07-11 19:35:36 +0300 |
commit | 223ba37ab5d81fc5f0d2ddb9a632f0d9c4db6a10 (patch) | |
tree | 50a23688f795d5b46bcee3f6fbcc9fd16b52c0fb | |
parent | b82954a5afd40b6b3e1e5db5c464500a697dcd6a (diff) | |
download | unit-223ba37ab5d81fc5f0d2ddb9a632f0d9c4db6a10.tar.gz unit-223ba37ab5d81fc5f0d2ddb9a632f0d9c4db6a10.tar.bz2 |
Tests: more chars in header values tests.
-rw-r--r-- | test/test_http_header.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_http_header.py b/test/test_http_header.py index 364ac9bd..f5388e9e 100644 --- a/test/test_http_header.py +++ b/test/test_http_header.py @@ -83,6 +83,26 @@ class TestUnitHTTPHeader(unit.TestUnitApplicationPython): self.assertEqual(resp['headers']['Custom-Header'], '(),/:;<=>?@[\]{}\t !#$%&\'*+-.^_`|~', 'value chars custom header') + def test_http_header_value_chars_edge(self): + self.load('custom_header') + + resp = self.get(headers={ + 'Custom-Header': '\x20\xFF' + }) + + self.assertEqual(resp['status'], 200, 'value chars edge status') + self.assertEqual(resp['headers']['Custom-Header'], '\xFF', + 'value chars edge') + + def test_http_header_value_chars_below(self): + self.load('custom_header') + + resp = self.get(headers={ + 'Custom-Header': '\x1F' + }) + + self.assertEqual(resp['status'], 400, 'value chars below') + def test_http_header_field_leading_sp(self): self.load('empty') |