X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;ds=sidebyside;f=lib%2FPlack%2FMiddleware%2FBasicStyle.pm;h=f207b35f7b03b40befcf90c02ccce96b7c17409d;hb=97773defa7e822b505d0b3fb1f7e177ddfe168db;hp=1692c8a7f8a4ab77543afb290981fd2e560aae1c;hpb=1c93f4de2cd1172dc66a27d6f92e1949834a8032;p=plack-middleware-basicstyle.git diff --git a/lib/Plack/Middleware/BasicStyle.pm b/lib/Plack/Middleware/BasicStyle.pm index 1692c8a..f207b35 100644 --- a/lib/Plack/Middleware/BasicStyle.pm +++ b/lib/Plack/Middleware/BasicStyle.pm @@ -12,7 +12,7 @@ use Plack::Util; use Plack::Util::Accessor qw/style any_content_type even_if_styled use_link_header/; our $VERSION = '0.001'; -our $DEFAULT_STYLE = < body { margin:40px auto; @@ -43,15 +43,15 @@ sub _content_type_ok { my $content_type = Plack::Util::header_get($hdrs, 'Content-Type'); return '' unless $content_type; - $content_type =~ m,text/html,i; + $content_type =~ m,text/html,is; } -sub call { +sub call { ## no critic (Complexity) my ($self, $env) = @_; if ($self->use_link_header) { my $req = Plack::Request->new($env); if (lc $req->path eq lc $self->use_link_header) { - my $days30 = 30 * 86400; + my $days30 = 30 * 86_400; my @hdrs = ( 'Content-Length' => length $self->style, 'Content-Type' => 'text/css', @@ -77,7 +77,7 @@ sub call { $doctype_end //= $offset_end if $tagname eq 'doctype'; $styled = 1 if $tagname eq 'style'; $styled = 1 if $tagname eq 'link' - && ($attr->{rel} // '') =~ /stylesheet/i; + && ($attr->{rel} // '') =~ /stylesheet/is; }; my $p = HTML::Parser->new(api_version => 3);