From e158d56a54d3c6d4890aa6ac4caa28a834279af0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 30 Jun 2016 09:13:21 +0000 Subject: www_stream: add response wrapper sub This encapsulates an entire PSGI response array, hopefully making it easier to generate responses and avoid typos when setting the Content-Type. --- lib/PublicInbox/SearchView.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 4af6cadb..30a310c9 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -55,9 +55,7 @@ sub sres_top_html { $cb = mset_summary($ctx, $mset, $q); } } - - [ $code, ['Content-Type', 'text/html; charset=UTF-8'], - PublicInbox::WwwStream->new($ctx, $cb) ]; + PublicInbox::WwwStream->response($ctx, $code, $cb); } # display non-threaded search results similar to what users expect from -- cgit v1.2.3-24-ge0c7