summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/t/50mimemap.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/50mimemap.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/50mimemap.t')
-rw-r--r--web/server/h2o/libh2o/t/50mimemap.t88
1 files changed, 0 insertions, 88 deletions
diff --git a/web/server/h2o/libh2o/t/50mimemap.t b/web/server/h2o/libh2o/t/50mimemap.t
deleted file mode 100644
index c85febd97..000000000
--- a/web/server/h2o/libh2o/t/50mimemap.t
+++ /dev/null
@@ -1,88 +0,0 @@
-use strict;
-use warnings;
-use Test::More;
-use t::Util;
-
-my $CURL_CMD = q{curl --silent --show-error --output /dev/null --write-out '%{content_type}'};
-
-plan skip_all => 'curl not found'
- unless prog_exists('curl');
-
-subtest "basic" => sub {
- my $server = spawn_h2o(<< 'EOT');
-hosts:
- default:
- paths:
- /:
- file.dir: t/50mimemap/doc_root
- /addtypes:
- file.dir: t/50mimemap/doc_root
- file.mime.addtypes:
- application/xhtml+xml: .xhtml
- /removetypes:
- file.dir: t/50mimemap/doc_root
- file.mime.removetypes:
- - .xhtml
- /settypes:
- file.dir: t/50mimemap/doc_root
- file.mime.settypes:
- text/xml: .xhtml
- file.mime.addtypes:
- application/xml: .xhtml
- default-type-test:
- paths:
- /:
- file.dir: t/50mimemap/doc_root
- file.mime.setdefaulttype: application/xhtml+xml
-file.index:
- - index.xhtml
-EOT
-
- my $port = $server->{port};
- my %expected = (
- '/' => 'application/xml',
- '/addtypes/' => 'application/xhtml+xml',
- '/removetypes/' => 'application/octet-stream',
- '/settypes/' => 'text/xml',
- );
-
- for my $path (sort keys %expected) {
- my $ct = `$CURL_CMD http://127.0.0.1:$port$path`;
- is $ct, $expected{$path}, "$path";
- $ct = `$CURL_CMD http://127.0.0.1:$port${path}index.xhtml`;
- is $ct, $expected{$path}, "${path}index.xhtml";
- }
-
- my $ct = `$CURL_CMD --header 'host: default-type-test' http://127.0.0.1:$port/`;
- is $ct, 'application/xhtml+xml', 'setdefaulttype';
-};
-
-subtest "issue730" => sub {
- my $server = spawn_h2o(<< 'EOT');
-hosts:
- default:
- paths:
- /:
- file.dir: t/assets/doc_root
-file.mime.addtypes:
- "text/plain; charset=mycharset": ".txt"
-EOT
- my $ct = `$CURL_CMD http://127.0.0.1:$server->{port}/index.txt`;
- is $ct, "text/plain; charset=mycharset";
-};
-
-subtest "reset mimemap to minimum" => sub {
- my $server = spawn_h2o(<< 'EOT');
-file.mime.setdefaulttype: "application/octet-stream"
-file.mime.settypes: {}
-hosts:
- default:
- paths:
- /:
- file.dir: t/assets/doc_root
-EOT
- my $ct = `$CURL_CMD http://127.0.0.1:$server->{port}/index.txt`;
- is $ct, "application/octet-stream";
-};
-
-done_testing;