diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-01-07 10:45:24 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2021-01-07 10:45:24 -0500 |
commit | 35675284a206bec76c2da7d2974d8599089f6cd0 (patch) | |
tree | 6f462fae0ca7cbcc0228ff64936a03f7d51088e7 | |
parent | 65521537a8f61b81c88d4b809c6e2a847c0b8401 (diff) | |
download | lighttpd-git-35675284a206bec76c2da7d2974d8599089f6cd0.tar.gz |
[doc] create-mime.conf.pl improve case handling
make create-mime.conf.pl more resilient to questionable edits
to /etc/mime.types
non-vnd.* subtype takes precedence over vnd.* subtype
(type/subtype, e.g. text/plain)
x-ref:
"lighttpd: does not start with media-types 1.1.0"
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=979232
-rwxr-xr-x | doc/scripts/create-mime.conf.pl | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/doc/scripts/create-mime.conf.pl b/doc/scripts/create-mime.conf.pl index fb6b3747..3cb421f6 100755 --- a/doc/scripts/create-mime.conf.pl +++ b/doc/scripts/create-mime.conf.pl @@ -120,15 +120,13 @@ sub add { } # non-vnd.* subtype wins over vnd.* subtype - if ($type eq $have_type) { - my $have_vnd = ($have_subtype =~ /^vnd\./); - if (($subtype =~ /^vnd\./) ^ $have_vnd) { - if ($have_vnd) { - return set @_; # overwrite - } - else { - return; # ignore - } + my $have_vnd = ($have_subtype =~ /^vnd\./); + if (($subtype =~ /^vnd\./) ^ $have_vnd) { + if ($have_vnd) { + return set @_; # overwrite + } + else { + return; # ignore } } |