summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-07-24 09:54:44 +0000
commit836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch)
tree1604da8f482d02effa033c94a84be42bc0c848c3 /web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz
netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t')
-rw-r--r--web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t68
1 files changed, 0 insertions, 68 deletions
diff --git a/web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t b/web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t
deleted file mode 100644
index da2aee2c2..000000000
--- a/web/server/h2o/libh2o/t/50reverse-proxy-preserve-case.t
+++ /dev/null
@@ -1,68 +0,0 @@
-use strict;
-use warnings;
-use Net::EmptyPort qw(check_port empty_port);
-use Test::More;
-use t::Util;
-
-plan skip_all => 'curl not found'
- unless prog_exists('curl');
-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;
-
-my $upstream_port = empty_port();
-
-my $upstream = new IO::Socket::INET (
- LocalHost => '127.0.0.1',
- LocalPort => $upstream_port,
- Proto => 'tcp',
- Listen => 1,
- Reuse => 1
-);
-die "cannot create socket $!\n" unless $upstream;
-
-sub handler_curl {
- my $socket = shift;
- my $client_socket = $socket->accept();
-
- my $data = "";
- $client_socket->recv($data, 4906);
-
- my $resp = "HTTP/1.0 200 Ok\r\nMyResponseHeader:1\r\nContent-Length:2\r\nConnection: close\r\n\r\nOk";
- $client_socket->send($resp);
- $client_socket->flush;
-
- close($client_socket);
- return $data;
-};
-
-
-my $server = spawn_h2o(<< "EOT");
-hosts:
- default:
- paths:
- /:
- proxy.reverse.url: http://127.0.0.1:$upstream_port
-EOT
-
-run_with_curl($server, sub {
- my ($proto, $port, $curl) = @_;
- open(CURL, "$curl -HUpper-Case:TheValue -kv $proto://127.0.0.1:$port/ 2>&1 |");
- my $forwarded = handler_curl($upstream);
- my @lines;
- while (<CURL>) {
- push(@lines, $_);
-
- }
- my $resp = join("", @lines);
- if ($curl =~ /http2/) {
- like($forwarded, qr{upper-case:\s*TheValue}, "Request header name is lowercased");
- like($resp, qr{myresponseheader:\s*1}, "Response header name is lowercase");
- } else {
- like($forwarded, qr{Upper-Case:\s*TheValue}, "Request header name is not lowercased");
- like($resp, qr{MyResponseHeader:\s*1}, "Response header name has case preserved");
- }
- });
-
-done_testing();