Skip Menu |

This queue is for tickets about the MIME-Types CPAN distribution.

Report information
The Basics
Id: 123298
Status: resolved
Priority: 0/
Queue: MIME-Types

People
Owner: Nobody in particular
Requestors: DIMOXFF [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.13
Fixed in: (no value)



Subject: MojoX::MIME::Types: Can't call method "extensions" on an undefined value
I get this error wjhen using MojoX::MIME::Types with Chrome, because it could not detect type for "image/apng" Can't call method "extensions" on an undefined value at /perls/perl-5.24.1/lib/site_perl/5.24.1/MojoX/MIME/Types.pm line 41. MIME::Types version 2.13 Possible fix: --- MIME-Types-2.13/lib/MojoX/MIME/Types.pm 2016-03-07 17:48:38.000000000 +0300 +++ MIME-Types-2.13-my/lib/MojoX/MIME/Types.pm 2017-10-16 15:15:42.371613158 +0300 @@ -38,7 +38,9 @@ sub detect($$;$) { my ($self, $accept, $prio) = @_; my $mt = $self->mimeTypes; - my @ext = map $mt->type($_)->extensions, + my @ext = map $_->extensions, + grep defined($_), + map $mt->type($_), grep !/\*/, $mt->httpAccept($accept); \@ext; }
Subject: fix.patch
diff -Naur MIME-Types-2.13/lib/MojoX/MIME/Types.pm MIME-Types-2.13-my/lib/MojoX/MIME/Types.pm --- MIME-Types-2.13/lib/MojoX/MIME/Types.pm 2016-03-07 17:48:38.000000000 +0300 +++ MIME-Types-2.13-my/lib/MojoX/MIME/Types.pm 2017-10-16 15:15:42.371613158 +0300 @@ -38,7 +38,9 @@ sub detect($$;$) { my ($self, $accept, $prio) = @_; my $mt = $self->mimeTypes; - my @ext = map $mt->type($_)->extensions, + my @ext = map $_->extensions, + grep defined($_), + map $mt->type($_), grep !/\*/, $mt->httpAccept($accept); \@ext; }
Subject: Re: [rt.cpan.org #123298] MojoX::MIME::Types: Can't call method "extensions" on an undefined value
Date: Mon, 16 Oct 2017 15:23:43 +0200
To: Dmitry Latin via RT <bug-MIME-Types [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Dmitry Latin via RT (bug-MIME-Types@rt.cpan.org) [171016 12:18]: Show quoted text
> Mon Oct 16 08:17:57 2017: Request 123298 was acted upon. > Transaction: Ticket created by DIMOXFF > Queue: MIME-Types > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=123298 > > > I get this error wjhen using MojoX::MIME::Types with Chrome, because > it could not detect type for "image/apng" > > Possible fix:
Your bug-report and your fix are correct. I looked whether any other of my mime-type sources lists includes an image/apng, but no-one does. The https://en.wikipedia.org/wiki/APNG explicitly states that there is no new mime-type for it. So, please explain me who defines it. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Will be released in 2.14 later today