| … | … | @@ -63,6 +63,25 @@ describe('generateVhosts (host mode)', () => { |
| 63 | 63 | const out = generateVhosts({ nodes: [], hosts: [] }) |
| 64 | 64 | assert.match(out, /^KeepAliveTimeout 65$/m) |
| 65 | 65 | }) |
| 66 | |
| 67 | // h2 multiplexes every request for a page over ONE connection, so the ~210ms |
| 68 | // handshake is paid once instead of per parallel connection. `Protocols` is a |
| 69 | // CORE directive (2.4.17+), so this is valid even before mod_http2 is enabled |
| 70 | // — an unavailable protocol is simply never negotiated, and clients stay on |
| 71 | // http/1.1. That ordering matters: the config can ship before the module. |
| 72 | it('offers h2 ahead of http/1.1 at SERVER context', () => { |
| 73 | const out = generateVhosts(registry) |
| 74 | assert.match(out, /^Protocols h2 http\/1\.1$/m, 'Protocols emitted') |
| 75 | |
| 76 | const proto = out.search(/^Protocols h2 http\/1\.1$/m) |
| 77 | const firstVhost = out.indexOf('<VirtualHost') |
| 78 | assert.ok(proto < firstVhost, 'precedes the first VirtualHost so the apex site inherits it') |
| 79 | }) |
| 80 | |
| 81 | it('emits Protocols even with no hosts registered', () => { |
| 82 | const out = generateVhosts({ nodes: [], hosts: [] }) |
| 83 | assert.match(out, /^Protocols h2 http\/1\.1$/m) |
| 84 | }) |
| 66 | 85 | }) |
| 67 | 86 | |
| 68 | 87 | describe('Registry host methods', () => { |