]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwListing.pm
get rid of unnecessary bytes::length usage
[public-inbox.git] / lib / PublicInbox / WwwListing.pm
index 76c76663a059889e5a1b52402486081de8b3791d..8b54d7249aad85538789b25668d86f5dbcabdf0b 100644 (file)
@@ -5,12 +5,12 @@
 # Used by PublicInbox::WWW
 package PublicInbox::WwwListing;
 use strict;
+use v5.10.1;
 use PublicInbox::Hval qw(prurl fmt_ts ascii_html);
 use PublicInbox::Linkify;
 use PublicInbox::GzipFilter qw(gzf_maybe);
 use PublicInbox::ConfigIter;
 use PublicInbox::WwwStream;
-use bytes (); # bytes::length
 
 sub ibx_entry {
        my ($ctx, $ibx, $ce) = @_;
@@ -55,7 +55,7 @@ again:
        } elsif ($v eq 'all') {
                (qr/./, undef);
        } elsif ($v eq '404') {
-               undef;
+               (undef, undef);
        } else {
                warn <<EOF;
 `$v' is not a valid value for `$key'
@@ -190,9 +190,9 @@ sub psgi_triple {
        my $h = [ 'Content-Type', 'text/html; charset=UTF-8',
                        'Content-Length', undef ];
        my $gzf = gzf_maybe($h, $ctx->{env});
-       $gzf->zmore('<html><head><title>' .
-                               'public-inbox listing</title>' .
-                               '</head><body>');
+       $gzf->zmore('<html><head><title>public-inbox listing</title>' .
+                       $ctx->{www}->style('+/') .
+                       '</head><body>');
        my $code = 404;
        if (my $list = delete $ctx->{-list}) {
                my $mset = delete $ctx->{-mset};
@@ -213,7 +213,7 @@ sub psgi_triple {
        my $out = $gzf->zflush('</pre><hr><pre>'.
                        PublicInbox::WwwStream::code_footer($ctx->{env}) .
                        '</pre></body></html>');
-       $h->[3] = bytes::length($out);
+       $h->[3] = length($out);
        [ $code, $h, [ $out ] ];
 }