1
0
mirror of https://github.com/apache/httpd.git synced 2026-10-23 22:49:01 +03:00
Files
apache/test/modules/http2/test_501_proxy_serverheader.py
Stefan Eissing 1d7ba6ce10 modern python fixes:
- rename hook parameter, because python thought this is a super good idea
- change call property to method because it no longer worked



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1933904 13f79535-47bb-0310-9956-ffa450edef68
2026-05-07 09:46:23 +00:00

37 lines
1.2 KiB
Python

import pytest
from .env import H2Conf, H2TestEnv
@pytest.mark.skipif(condition=H2TestEnv.is_unsupported(), reason="mod_http2 not supported here")
class TestProxyServerHeader:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
conf = H2Conf(env, extras={
f'cgi.{env.http_tld}': [
"Header unset Server",
"Header always set Server cgi",
]
})
conf.add_vhost_cgi(proxy_self=True, h2proxy_self=False)
conf.install()
assert env.apache_restart() == 0
def setup_method(self, method):
print("setup_method: %s" % method.__name__)
def teardown_method(self, method):
print("teardown_method: %s" % method.__name__)
def test_h2_501_01(self, env):
url = env.mkurl("https", "cgi", "/proxy/hello.py")
r = env.curl_get(url, 5)
assert r.response["status"] == 200
assert "HTTP/1.1" == r.response["json"]["protocol"]
assert "" == r.response["json"]["https"]
assert "" == r.response["json"]["ssl_protocol"]
assert "" == r.response["json"]["h2"]
assert "" == r.response["json"]["h2push"]
assert "cgi" == r.response["header"]["server"]