From b9b12ac92230cc6807623293b93cc22e5eb33684 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Mar 2017 00:55:07 +0000 Subject: repobrowse: consistently set text charset For everything with relevant content, we'll try to set UTF-8 charset and reduce duplication when generating response headers. --- lib/PublicInbox/RepoGitTag.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/RepoGitTag.pm') diff --git a/lib/PublicInbox/RepoGitTag.pm b/lib/PublicInbox/RepoGitTag.pm index 785de6b1..2a281ed6 100644 --- a/lib/PublicInbox/RepoGitTag.pm +++ b/lib/PublicInbox/RepoGitTag.pm @@ -78,13 +78,12 @@ sub git_tag_show { my ($self, $req, $h, $res) = @_; my $git = $req->{-repo}->{git}; my $fh; - my $hdr = ['Content-Type', 'text/html; charset=UTF-8']; # yes, this could still theoretically show anything, # but a tag could also point to anything: $git->cat_file("refs/tags/$h", sub { my ($cat, $left, $type, $hex) = @_; - $fh = $res->([200, $hdr]); + $fh = $res->($self->rt(200, 'html')); $h = PublicInbox::Hval->utf8($h); my $m = "git_show_${type}_as_tag"; @@ -97,7 +96,7 @@ sub git_tag_show { } }); unless ($fh) { - $fh = $res->([404, $hdr]); + $fh = $res->($self->rt(404, 'html')); $fh->write(invalid_tag_start($req, $h)); } $fh->write(''); -- cgit v1.2.3-24-ge0c7