diff options
author | Eric Wong <e@80x24.org> | 2020-01-01 10:38:56 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-01-01 19:10:55 +0000 |
commit | 02f9b34f398bef722159cd54a629441f861d37b7 (patch) | |
tree | 8d58442693e693921785bd004cd1b3cb8e30266d /lib/PublicInbox/WwwHighlight.pm | |
parent | 6348b9adcf8a7d4a455298f45f62338e148d691a (diff) | |
download | public-inbox-02f9b34f398bef722159cd54a629441f861d37b7.tar.gz |
Remove redundant "r" functions for generating short error responses. These responses will no longer be cached by clients, which is probably a good thing since most errors ought to be transient, anyways. This also fixes error responses for our cgit wrapper when static files are missing.
Diffstat (limited to 'lib/PublicInbox/WwwHighlight.pm')
-rw-r--r-- | lib/PublicInbox/WwwHighlight.pm | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/PublicInbox/WwwHighlight.pm b/lib/PublicInbox/WwwHighlight.pm index bc349f8a..6312edae 100644 --- a/lib/PublicInbox/WwwHighlight.pm +++ b/lib/PublicInbox/WwwHighlight.pm @@ -22,22 +22,15 @@ package PublicInbox::WwwHighlight; use strict; use warnings; use bytes (); # only for bytes::length -use HTTP::Status qw(status_message); use parent qw(PublicInbox::HlMod); use PublicInbox::Linkify qw(); use PublicInbox::Hval qw(ascii_html); +use PublicInbox::WwwStatic qw(r); # TODO: support highlight(1) for distros which don't package the # SWIG extension. Also, there may be admins who don't want to # have ugly SWIG-generated code in a long-lived Perl process. -sub r ($) { - my ($code) = @_; - my $msg = status_message($code); - my $len = length($msg); - [ $code, [qw(Content-Type text/plain Content-Length), $len], [$msg] ] -} - # another slurp API hogging up all my memory :< # This is capped by whatever the PSGI server allows, # $ENV{GIT_HTTP_MAX_REQUEST_BUFFER} for PublicInbox::HTTP (10 MB) |