Re: [PATCH v8 1/3] gitweb: add `status` headers to git_feed() responses.
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Mar 30, 2012, 15:21 UTC
- Message-ID
- <201203301721.52657.jnareb@gmail.com>
- In-Reply-To
- <4958e06536924de10105bb453d88e8f4c28bb8c1.1333024238.git.wking@drexel.edu>
On Thu, 29 Mar 2012, W. Trevor King wrote:
> The git_feed() method was not setting a `Status` header unless it was > responding to an If-Modified-Since request with `304 Not Modified`. > Now, when it is serving successful responses, it sets status to > `200 OK`.
Nice. This change is IMHO worth applying even without the rest of series. So
Acked-by: Jakub Narebski <jnareb@gmail.com>
You _might_ also add that this change would allow robust testing of If-Modified-Since request handling in gitweb, but it is not really necessary.
Show 28 quoted lines
>
> Signed-off-by: W Trevor King <wking@drexel.edu>
> ---
> gitweb/gitweb.perl | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index a8b5fad..041da17 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -7841,11 +7841,13 @@ sub git_feed {
> print $cgi->header(
> -type => $content_type,
> -charset => 'utf-8',
> - -last_modified => $latest_date{'rfc2822'});
> + -last_modified => $latest_date{'rfc2822'},
> + -status => '200 OK');
> } else {
> print $cgi->header(
> -type => $content_type,
> - -charset => 'utf-8');
> + -charset => 'utf-8',
> + -status => '200 OK');
> }
>
> # Optimization: skip generating the body if client asks only
> --
> 1.7.3.4-- Jakub Narebski Poland