From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Yi, EungJun" <semtlenori@gmail.com>, git@vger.kernel.org
Subject: Re: More detailed error message for 403 forbidden.
Date: Thu, 28 Mar 2013 16:18:26 -0400 [thread overview]
Message-ID: <20130328201826.GA24103@sigill.intra.peff.net> (raw)
In-Reply-To: <7vk3ortk3o.fsf@alter.siamese.dyndns.org>
On Thu, Mar 28, 2013 at 12:11:55PM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > One problem is that the content body sent along with the error is not
> > necessarily appropriate for showing to the user (e.g., if it is HTML, it
> > is probably not a good idea to show it on the terminal). So I think we
> > would want to only show it when the server has indicated via the
> > content-type that the message is meant to be shown to the user. I'm
> > thinking the server would generate something like:
> >
> > HTTP/1.1 403 Forbidden
> > Content-type: application/x-git-error-message
> >
> > User 'me' does not have enough permission to access the repository.
> >
> > which would produce the example you showed above.
>
> Actually, isn't the human-readable part of the server response meant
> for this kind of thing? I.e.
>
> HTTP/1.1 403 User 'me' not allowed to accept the repository.
In theory, yes. But I don't think that most servers make it very easy to
use custom "reason phrases" (that is the rfc 2616 term for them). At
least I could not easily figure out how to make Apache do so. You can do
so from CGIs, but I think you'd want to customize some of this at the
HTTP server level (e.g., overriding 404s with a custom message). There's
much better support at that level for custom error documents (e.g.,
Apache's ErrorDocument).
I do not configure http servers very often, though, so I could be wrong
about what is normal practice, and what is easy to do.
-Peff
prev parent reply other threads:[~2013-03-28 20:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-27 3:29 More detailed error message for 403 forbidden Yi, EungJun
2013-03-28 18:36 ` Jeff King
2013-03-28 18:41 ` Jonathan Nieder
2013-03-28 18:45 ` Jeff King
2013-03-31 9:17 ` Yi, EungJun
2013-03-28 19:11 ` Junio C Hamano
2013-03-28 20:18 ` Jeff King [this message]
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=20130328201826.GA24103@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=semtlenori@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).