Slide 33
Slide 33 text
HTTP/2 Extension
if %env eq 'HTTP/1.1'
&& %env ~~ /\/
&& %env eq 'h2c'
&& any(|%env) ~~ 'h2c' {
101, [ P6SGIx-Upgrade => 'h2c' ], []
}
if %env eq '/index.html' {
if %env eq 'HTTP/2' {
%env.emit([
':method' => 'GET',
':scheme' => 'http',
':path' => 'foo.png',
]);
}
200, [ 'Content-Type' => 'text/html' ], ...
}
elsif %env eq '/foo.png' {
200, [ 'Content-Type' => 'image/png' ], ...
}
33