diff options
author | Eric Wong <e@80x24.org> | 2017-03-03 00:55:07 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-03-03 00:55:07 +0000 |
commit | b9b12ac92230cc6807623293b93cc22e5eb33684 (patch) | |
tree | e05c029ebd6a16bbd9dd5045dcff7d2701794235 /lib/PublicInbox/RepoGitTag.pm | |
parent | 16b1fbe36cc39a351ef9810b9018d36df833a941 (diff) | |
download | public-inbox-b9b12ac92230cc6807623293b93cc22e5eb33684.tar.gz |
For everything with relevant content, we'll try to set UTF-8 charset and reduce duplication when generating response headers.
Diffstat (limited to 'lib/PublicInbox/RepoGitTag.pm')
-rw-r--r-- | lib/PublicInbox/RepoGitTag.pm | 5 |
1 files changed, 2 insertions, 3 deletions
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('</pre></body></html>'); |