MCPcopy Create free account
hub / github.com/apache/httpd / H2Conf

Class H2Conf

test/modules/http2/env.py:97–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96
97class H2Conf(HttpdConf):
98
99 def __init__(self, env: HttpdTestEnv, extras: Dict[str, Any] = None):
100 super().__init__(env=env, extras=HttpdConf.merge_extras(extras, {
101 f"cgi.{env.http_tld}": [
102 "SSLOptions +StdEnvVars",
103 "AddHandler cgi-script .py",
104 "<Location \"/h2test/echo\">",
105 " SetHandler h2test-echo",
106 "</Location>",
107 "<Location \"/h2test/delay\">",
108 " SetHandler h2test-delay",
109 "</Location>",
110 "<Location \"/h2test/error\">",
111 " SetHandler h2test-error",
112 "</Location>",
113 ]
114 }))
115
116 def start_vhost(self, domains, port=None, doc_root="htdocs", with_ssl=None,
117 ssl_module=None, with_certificates=None):
118 super().start_vhost(domains=domains, port=port, doc_root=doc_root,
119 with_ssl=with_ssl, ssl_module=ssl_module,
120 with_certificates=with_certificates)
121 if f"noh2.{self.env.http_tld}" in domains:
122 protos = ["http/1.1"]
123 elif port == self.env.https_port or with_ssl is True:
124 protos = ["h2", "http/1.1"]
125 else:
126 protos = ["h2c", "http/1.1"]
127 if f"test2.{self.env.http_tld}" in domains:
128 protos = reversed(protos)
129 self.add(f"Protocols {' '.join(protos)}")
130 return self
131
132 def add_vhost_noh2(self):
133 domains = [f"noh2.{self.env.http_tld}", f"noh2-alias.{self.env.http_tld}"]
134 self.start_vhost(domains=domains, port=self.env.https_port, doc_root="htdocs/noh2")
135 self.add(["Protocols http/1.1", "SSLOptions +StdEnvVars"])
136 self.end_vhost()
137 self.start_vhost(domains=domains, port=self.env.http_port, doc_root="htdocs/noh2")
138 self.add(["Protocols http/1.1", "SSLOptions +StdEnvVars"])
139 self.end_vhost()
140 return self
141
142 def add_vhost_test1(self, proxy_self=False, h2proxy_self=False):
143 return super().add_vhost_test1(proxy_self=proxy_self, h2proxy_self=h2proxy_self)
144
145 def add_vhost_test2(self):
146 return super().add_vhost_test2()

Callers 15

_class_scopeMethod · 0.85
_class_scopeMethod · 0.85
test_h2_105_01Method · 0.85
test_h2_105_02Method · 0.85
test_h2_105_03Method · 0.85
test_h2_105_10Method · 0.85
test_h2_105_11Method · 0.85
test_h2_105_12Method · 0.85
_class_scopeMethod · 0.85
_class_scopeMethod · 0.85
_class_scopeMethod · 0.85
_class_scopeMethod · 0.85

Calls

no outgoing calls

Tested by 15

_class_scopeMethod · 0.68
_class_scopeMethod · 0.68
test_h2_105_01Method · 0.68
test_h2_105_02Method · 0.68
test_h2_105_03Method · 0.68
test_h2_105_10Method · 0.68
test_h2_105_11Method · 0.68
test_h2_105_12Method · 0.68
_class_scopeMethod · 0.68
_class_scopeMethod · 0.68
_class_scopeMethod · 0.68
_class_scopeMethod · 0.68