choroba has asked for the wisdom of the Perl Monks concerning the following question:
Before upgrading, I ran
cpan -a
to create the "autobundle" of all the installed modules.
After upgrading, though, I realized the autobundle includes all the non-core modules, i.e. also the ones installed by the system vendor (zypper install perl-*). So, I iterated over the list of modules, tried to run perl -M$module -e1 for each of them, and only installed those that failed.
On one of the machines, Dancer failed to install with the following test failures:
t/04_static_file/01_mime_types.t .................... 1/10 # Failed test 'a mime_type is found with MIME::Types' # at t/04_static_file/01_mime_types.t line 16. # got: 'application/vnd.easykaraoke.cdgdownload' # expected: 'application/zip' # Looks like you failed 1 test of 10. t/04_static_file/01_mime_types.t .................... Dubious, test re +turned 1 (wstat 256, 0x100) Failed 1/10 subtests t/04_static_file/02_dir_traversal.t ................. ok t/05_views/002_view_rendering.t ..................... ok t/05_views/03_layout.t .............................. ok t/06_helpers/000_create_fake_env.t .................. ok t/06_helpers/01_send_file.t ......................... 1/25 # Failed test 'mime_type can be forced' # at t/06_helpers/01_send_file.t line 83. # got: 'image/vnd.mozilla.apng' # expected: 'image/png' # Looks like you failed 1 test of 25. t/06_helpers/01_send_file.t ......................... Dubious, test re +turned 1 (wstat 256, 0x100) Failed 1/25 subtests t/06_helpers/02_http_status.t ....................... ok t/06_helpers/03_content_type.t ...................... 1/6 # Failed test 'headers include expected data for GET /png' # at t/06_helpers/03_content_type.t line 36. # Looks like you failed 1 test of 6.
And indeed,
perl -MMIME::Types -wE 'say MIME::Types->new->mimeTypeOf("zip")'
returns application/vnd.easykaraoke.cdgdownload on that machine, while on others, it returns the expected application/zip. Any idea why that happens and how to fix it?
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected behaviour of MIME::Types
by Perlbotics (Archbishop) on Jan 28, 2018 at 15:39 UTC | |
by choroba (Cardinal) on Jan 28, 2018 at 17:37 UTC | |
|
Re: Unexpected behaviour of MIME::Types
by karlgoethebier (Abbot) on Jan 30, 2018 at 14:18 UTC |