diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:20:02 +0000 |
commit | 58daab21cd043e1dc37024a7f99b396788372918 (patch) | |
tree | 96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /web/server/h2o/libh2o/t/80issues579.t | |
parent | Releasing debian version 1.43.2-1. (diff) | |
download | netdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz netdata-58daab21cd043e1dc37024a7f99b396788372918.zip |
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/t/80issues579.t')
-rw-r--r-- | web/server/h2o/libh2o/t/80issues579.t | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/t/80issues579.t b/web/server/h2o/libh2o/t/80issues579.t new file mode 100644 index 000000000..046e188ad --- /dev/null +++ b/web/server/h2o/libh2o/t/80issues579.t @@ -0,0 +1,45 @@ +use strict; +use warnings; +use Net::EmptyPort qw(check_port empty_port); +use Test::More; +use t::Util; + +plan skip_all => 'mruby support is off' + unless server_features()->{mruby}; +plan skip_all => 'plackup not found' + unless prog_exists('plackup'); +plan skip_all => 'Starlet not found' + unless system('perl -MStarlet /dev/null > /dev/null 2>&1') == 0; +plan skip_all => 'nghttp not found' + unless prog_exists('nghttp'); + +# spawn upstream +my $upstream_port = empty_port(); +my $upstream = spawn_server( + argv => [ + qw(plackup -s Starlet --access-log /dev/null -p), $upstream_port, ASSETS_DIR . "/upstream.psgi", + ], + is_ready => sub { + check_port($upstream_port); + }, +); + +# spawn server +my $server = spawn_h2o(<< "EOT"); +hosts: + default: + paths: + /: + mruby.handler: | + Proc.new do |env| + [399, {"link" => "</assets/index.js>; rel=preload"}, []] + end + proxy.reverse.url: http://127.0.0.1:$upstream_port + /assets: + file.dir: @{[DOC_ROOT]} +EOT + +my $resp = `nghttp -n --stat "http://127.0.0.1:$server->{port}/index.txt"`; +like $resp, qr{\nid\s*responseEnd\s.*\s/assets/index\.js\n.*\s/index\.txt\n}is, 'should receive pushed blocking asset from file handler before the main response'; + +done_testing; |