From: Jakub Narebski <jnareb@gmail.com>
To: Lea Wiemann <lewiemann@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: return correct HTTP status codes
Date: Tue, 17 Jun 2008 00:34:41 +0200 [thread overview]
Message-ID: <200806170034.42621.jnareb@gmail.com> (raw)
In-Reply-To: <4856DFE8.9010809@gmail.com>
On Mon, 16 Jun 2008, Lea Wiemann wrote:
> Jakub Narebski wrote:
>>
>> Well, we could, perhaps, examine stderr (or redirect it to stdout and
>> examine upon error) to check what was the error.
>
> We don't have to -- gitweb's current (suboptimal) error checking is
> because it doesn't interface with git very well.
The "examine stderr" was a bit tongue-in-cheek, i.e. solution which
would require least changes... but I guess very impractical.
> The API I'm writing
> will fix this (i.e. provide proper feedback in all cases) so we'll have
> more specific status codes. IOW, we'll be able to differentiate between
> 500 and 404. Trust me on this one. ;-)
I have thought that Git.pm API together with catching (and examining)
Error, perhaps with redirecting STDERR somewhere (but it would be best
if it would not be needed) would be enough.
>> But I think in all, or almost all cases, the source is wrong parameters
>> in URL. Now, returning 5xx _server_ error would make me want to email
>> webmaster about error on his/her server, while 4xx _user_ error would
>> make me examine my input
>
> Since the status codes will get better (more accurate) anyway, I care
> more about correctness than practicalities right now (and I'm convinced
> that only 500 is correct in the cases we're talking about). That said,
> if you really want 404s in there, go ahead and send a follow-up patch, I
> won't object.
If the source of error is some misconfiguration on server, then 5xx is
appropriate (for example git binary is not found, something which
perhaps we should check upfront at the beginning). But I think it
should be very, very rare, and result of misconfigured gitweb, or error
installing git... or corrupted repository.
If source of error is mistake in URL, I would certainly want 4xx error.
So the user knows that he/she has to look at the URL.
That said, perhaps I am worrying over nothing, and
or die_error(undef, "Open <git command> failed");
can happen only on some serious server error (like corrupted
repository).
>From RFC 2616 (http://tools.ietf.org/html/rfc2616)
10.4 Client Error 4xx
The 4xx class of status code is intended for cases in which the
client seems to have erred.
[...]
10.5 Server Error 5xx
Response status codes beginning with the digit "5" indicate cases in
which the server is aware that it has erred or is incapable of
performing the request.
>> BTW. I got three copies of this email: was it you fighting VGER
>> anti-spam filter?
>
> Yup. Apparently it simply greps for Content-TypXe: text/hXtml. *shakes
> head* :-)
It is unfortunately very simple pattern based filter, not Markovian,
spam/ham Bayesian, or even simple Bayesian.
--
Jakub Narebski
Poland
next prev parent reply other threads:[~2008-06-16 22:35 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-15 21:15 [PATCH] gitweb: return correct HTTP status codes Lea Wiemann
2008-06-15 22:48 ` Jakub Narebski
2008-06-16 15:57 ` Lea Wiemann
2008-06-16 16:43 ` Jakub Narebski
2008-06-16 21:49 ` Lea Wiemann
2008-06-16 22:34 ` Jakub Narebski [this message]
2008-06-17 13:53 ` Lea Wiemann
2008-06-16 22:38 ` Junio C Hamano
2008-06-17 14:04 ` Lea Wiemann
2008-06-17 14:33 ` Jakub Narebski
2008-06-17 22:28 ` Lea Wiemann
2008-06-17 22:54 ` Jakub Narebski
2008-06-17 23:47 ` Lea Wiemann
2008-06-18 0:12 ` Jakub Narebski
2008-06-18 1:25 ` Lea Wiemann
2008-06-18 7:35 ` Jakub Narebski
2008-06-16 23:37 ` Jakub Narebski
2008-06-18 0:15 ` [PATCH] gitweb: standarize " Lea Wiemann
2008-06-19 0:51 ` [PATCH v2] " Jakub Narebski
2008-06-19 19:08 ` Lea Wiemann
2008-06-19 20:03 ` [PATCH v3] " Lea Wiemann
2008-06-19 20:25 ` Lea Wiemann
2008-06-19 22:37 ` Jakub Narebski
2008-06-20 0:48 ` Junio C Hamano
2008-06-19 22:22 ` [PATCH v2] " Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806170034.42621.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
--cc=lewiemann@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).