DOKK / manpages / debian 12 / libplack-perl / Plack::MIME.3pm.en
Plack::MIME(3pm) User Contributed Perl Documentation Plack::MIME(3pm)

Plack::MIME - MIME type registry

  use Plack::MIME;
  my $mime = Plack::MIME->mime_type(".png"); # image/png
  # register new type(s)
  Plack::MIME->add_type(".foo" => "application/x-foo");
  # Use MIME::Types as a fallback
  use MIME::Types 'by_suffix';
  Plack::MIME->set_fallback(sub { (by_suffix $_[0])[0] });

Plack::MIME is a simple MIME type registry for Plack applications. The selection of MIME types is based on Rack's Rack::Mime module.

Rack::Mime <https://github.com/rack/rack/blob/master/lib/rack/mime.rb> MIME::Types

2022-09-06 perl v5.34.0