Browse Source

[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
master
Glenn Strauss 4 months ago
parent
commit
35675284a2
  1. 16
      doc/scripts/create-mime.conf.pl

16
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
}
}

Loading…
Cancel
Save