]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwAltId.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / WwwAltId.pm
index b90819a2d8a10bf3360facd5f341e65f698914cd..470561608f5df47b746cd5bab5680d23b47f3c33 100644 (file)
@@ -15,8 +15,7 @@ sub check_output {
        my ($r, $bref, $ctx) = @_;
        return html_oneshot($ctx, 500) if !defined($r);
        if ($r == 0) {
-               my $err = eval { $ctx->{env}->{'psgi.errors'} } // \*STDERR;
-               $err->print("unexpected EOF from sqlite3\n");
+               warn 'unexpected EOF from sqlite3';
                return html_oneshot($ctx, 501);
        }
        [200, [ qw(Content-Type application/gzip), 'Content-Disposition',
@@ -34,28 +33,28 @@ sub sqldump ($$) {
        my $altid_map = $ibx->altid_map;
        my $fn = $altid_map->{$altid_pfx};
        unless (defined $fn) {
-               return html_oneshot($ctx, 404, \<<EOF);
+               return html_oneshot($ctx, 404, <<EOF);
 <pre>`$altid_pfx' is not a valid altid for this inbox</pre>
 EOF
        }
 
        if ($env->{REQUEST_METHOD} ne 'POST') {
                my $url = $ibx->base_url($ctx->{env}) . "$altid_pfx.sql.gz";
-               return html_oneshot($ctx, 405, \<<EOF);
-<pre>A POST request required to retrieve $altid_pfx.sql.gz
+               return html_oneshot($ctx, 405, <<EOF);
+<pre>A POST request is required to retrieve $altid_pfx.sql.gz
 
-       curl -XPOST -O $url
+       curl -d '' -O $url
 
 or
 
-       curl -XPOST $url | \\
+       curl -d '' $url | \\
                gzip -dc | \\
                sqlite3 /path/to/$altid_pfx.sqlite3
 </pre>
 EOF
        }
 
-       $sqlite3 //= which('sqlite3') // return html_oneshot($ctx, 501, \<<EOF);
+       $sqlite3 //= which('sqlite3') // return html_oneshot($ctx, 501, <<EOF);
 <pre>sqlite3 not available
 
 The administrator needs to install the sqlite3(1) binary