]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WWW.pm
feed: various object-orientation cleanups
[public-inbox.git] / lib / PublicInbox / WWW.pm
index 78b8826e2287ae9cdd29a5d30cf4cdc695f2df32..f1f4abd5f86d517383683bb67fc989fdcd3f0c0e 100644 (file)
@@ -47,6 +47,7 @@ sub call {
        # we don't care about multi-value
        my %qp = map {
                my ($k, $v) = split('=', $_, 2);
+               $v = '' unless defined $v;
                ($k, $v)
        } split(/[&;]/, uri_unescape($env->{QUERY_STRING}));
        $ctx->{qp} = \%qp;
@@ -205,9 +206,7 @@ sub get_index {
 # just returns a string ref for the blob in the current ctx
 sub mid2blob {
        my ($ctx) = @_;
-       require PublicInbox::MID;
-       my $path = PublicInbox::MID::mid2path($ctx->{mid});
-       $ctx->{git}->cat_file("HEAD:$path");
+       $ctx->{-inbox}->msg_by_mid($ctx->{mid});
 }
 
 # /$INBOX/$MESSAGE_ID/raw                    -> raw mbox