diff options
author | Stefan Eissing <icing@apache.org> | 2022-10-19 11:16:30 +0200 |
---|---|---|
committer | Stefan Eissing <icing@apache.org> | 2022-10-19 11:16:30 +0200 |
commit | f3ab5c5dd6d1f4debbb38c282521300c2b64fe45 (patch) | |
tree | b770d8250986eba09828a671e01cf9aebe2dee61 /test/modules/http1/test_007_strict.py | |
parent | mod_dav: Follow up to r1904638: Fix duplicated APLOGNO. (diff) | |
download | apache2-f3ab5c5dd6d1f4debbb38c282521300c2b64fe45.tar.xz apache2-f3ab5c5dd6d1f4debbb38c282521300c2b64fe45.zip |
tests modules/http1: use "Header add" to produce response headers with whitespace.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1904693 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/modules/http1/test_007_strict.py')
-rw-r--r-- | test/modules/http1/test_007_strict.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/modules/http1/test_007_strict.py b/test/modules/http1/test_007_strict.py index 4649b01123..78182419dc 100644 --- a/test/modules/http1/test_007_strict.py +++ b/test/modules/http1/test_007_strict.py @@ -67,3 +67,31 @@ class TestRequestStrict: assert int(m.group(1)) == status, f"{rlines}" else: assert int(m.group(1)) >= 400, f"{rlines}" + + @pytest.mark.parametrize(["hvalue", "expvalue"], [ + ['123', '123'], + ['123 ', '123 '], # trailing space stays + ['123\t', '123\t'], # trailing tab stays + [' 123', '123'], # leading space is stripped + [' 123', '123'], # leading spaces are stripped + ['\t123', '123'], # leading tab is stripped + ]) + def test_h1_007_02(self, env, hvalue, expvalue): + hname = 'ap-test-007' + conf = H1Conf(env, extras={ + f'test1.{env.http_tld}': [ + '<Location />', + f'Header add {hname} "{hvalue}"', + '</Location>', + ] + }) + conf.add_vhost_test1( + proxy_self=True + ) + conf.install() + assert env.apache_restart() == 0 + url = env.mkurl("https", "test1", "/") + r = env.curl_get(url, options=['--http1.1']) + assert r.response["status"] == 200 + assert r.response["header"][hname] == expvalue + |