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

Method _class_scope

test/modules/http2/test_400_push.py:12–59  ·  view source on GitHub ↗
(self, env)

Source from the content-addressed store, hash-verified

10
11 @pytest.fixture(autouse=True, scope='class')
12 def _class_scope(self, env):
13 H2Conf(env).start_vhost(domains=[f"push.{env.http_tld}"],
14 port=env.https_port, doc_root="htdocs/test1"
15 ).add(r"""
16 RewriteEngine on
17 RewriteRule ^/006-push(.*)?\.html$ /006.html
18 <Location /006-push.html>
19 Header add Link "</006/006.css>;rel=preload"
20 Header add Link "</006/006.js>;rel=preloadX"
21 </Location>
22 <Location /006-push2.html>
23 Header add Link "</006/006.css>;rel=preloadX, </006/006.js>; rel=preload"
24 </Location>
25 <Location /006-push3.html>
26 Header add Link "</006/006.css>;rel=preloa,</006/006.js>;rel=preload"
27 </Location>
28 <Location /006-push4.html>
29 Header add Link "</006/006.css;rel=preload, </006/006.js>; preload"
30 </Location>
31 <Location /006-push5.html>
32 Header add Link '</006/006.css>;rel="preload push"'
33 </Location>
34 <Location /006-push6.html>
35 Header add Link '</006/006.css>;rel="push preload"'
36 </Location>
37 <Location /006-push7.html>
38 Header add Link '</006/006.css>;rel="abc preload push"'
39 </Location>
40 <Location /006-push8.html>
41 Header add Link '</006/006.css>;rel="preload"; nopush'
42 </Location>
43 <Location /006-push20.html>
44 H2PushResource "/006/006.css" critical
45 H2PushResource "/006/006.js"
46 </Location>
47 <Location /006-push30.html>
48 H2Push off
49 Header add Link '</006/006.css>;rel="preload"'
50 </Location>
51 <Location /006-push31.html>
52 H2PushResource "/006/006.css" critical
53 </Location>
54 <Location /006-push32.html>
55 Header add Link "</006/006.css>;rel=preload"
56 </Location>
57 """).end_vhost(
58 ).install()
59 assert env.apache_restart() == 0
60
61 ############################
62 # Link: header handling, various combinations

Callers

nothing calls this directly

Calls 6

H2ConfClass · 0.85
installMethod · 0.80
end_vhostMethod · 0.80
addMethod · 0.80
apache_restartMethod · 0.80
start_vhostMethod · 0.45

Tested by

no test coverage detected