Skip Menu |

This queue is for tickets about the HTTP-Server-Simple-Static CPAN distribution.

Report information
The Basics
Id: 113980
Status: resolved
Priority: 0/
Queue: HTTP-Server-Simple-Static

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

Bug Information
Severity: (no value)
Broken in: 0.09
Fixed in: 0.11



Subject: Switching to 0.09 over 0.07 broke our Smolder install
I migrated an install of Smolder to a new box, and installed latest/greatest modules as part of it. When I did that, I found that I was getting incorrect Content-Type headers served up, as described in #91321. My smoking gun was: perl -MData::Dumper -MFile::LibMagic -e'$x=File::LibMagic->new->info_from_filename("/usr/local/share/perl5/auto/share/dist/Smolder/htdocs/style/style.css"); print Dumper $x;' $VAR1 = { 'mime_with_encoding' => 'text/x-c; charset=us-ascii', 'description' => 'ASCII C program text', 'encoding' => 'us-ascii', 'mime_type' => 'text/x-c' }; Reverting to version 0.07 of HTTP::Server::Simple::Static solved my problems.
Thanks for the reminder, I had forgotten about this issue. I've just uploaded version 0.10 which does the simple obvious thing for file names which match *.html?, *.css and *.txt. It still uses LibMagic for anything else. Stephen On Mon Apr 25 16:10:23 2016, PETDANCE wrote: Show quoted text
> I migrated an install of Smolder to a new box, and installed > latest/greatest modules as part of it. When I did that, I found that > I was getting incorrect Content-Type headers served up, as described > in #91321. > > My smoking gun was: > > perl -MData::Dumper -MFile::LibMagic -e'$x=File::LibMagic->new-
> >info_from_filename("/usr/local/share/perl5/auto/share/dist/Smolder/htdocs/style/style.css");
> print Dumper $x;' > $VAR1 = { > 'mime_with_encoding' => 'text/x-c; charset=us-ascii', > 'description' => 'ASCII C program text', > 'encoding' => 'us-ascii', > 'mime_type' => 'text/x-c' > }; > > Reverting to version 0.07 of HTTP::Server::Simple::Static solved my > problems.
The one that actually broke the smolder install was .js files. Firefox would fetch the .js file correctly, but not process it as JavaScript because the Content-Type was wrong. I apologize for not mentioning that in the first place.
On Wed Apr 27 10:19:08 2016, PETDANCE wrote: Show quoted text
> The one that actually broke the smolder install was .js files. > Firefox would fetch the .js file correctly, but not process it as > JavaScript because the Content-Type was wrong. > > I apologize for not mentioning that in the first place.
ok, I've added in a mapping for *.js to application/javascript. This makes me wonder if I'd be better using the MIME::Types module to do this sort of thing. I'll think a bit more about whether that would be better than using LibMagic which is clearly not that reliable. Stephen
This was fixed in version 0.11. Regards, Stephen Quinney On Wed Apr 27 11:19:09 2016, SJQUINNEY wrote: Show quoted text
> On Wed Apr 27 10:19:08 2016, PETDANCE wrote:
> > The one that actually broke the smolder install was .js files. > > Firefox would fetch the .js file correctly, but not process it as > > JavaScript because the Content-Type was wrong. > > > > I apologize for not mentioning that in the first place.
> > ok, I've added in a mapping for *.js to application/javascript. This > makes me wonder if I'd be better using the MIME::Types module to do > this sort of thing. I'll think a bit more about whether that would be > better than using LibMagic which is clearly not that reliable. > > > Stephen