From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
rctay89@gmail.com, "Shawn O. Pearce" <spearce@spearce.org>
Subject: Re: [PATCH] Document the HTTP transport protocols
Date: Wed, 21 Aug 2013 18:00:21 -0400 [thread overview]
Message-ID: <20130821220021.GA32130@sigill.intra.peff.net> (raw)
In-Reply-To: <1377092713-25434-1-git-send-email-pclouds@gmail.com>
On Wed, Aug 21, 2013 at 08:45:13PM +0700, Nguyen Thai Ngoc Duy wrote:
> On the topic, C Git's (maybe) violations on this spec are:
>
> - The client does not strip trailing slashes from $GIT_URL before
> sending to the server, as described in section "URL Format".
Yeah. We get the basic gist right by not adding an extra "/" if there is
already a trailing slash (so you do not have http://host/path//info/refs").
But we do not go out of our way to remove multiple slashes that the user
hands out (either at the end or in the middle of the URL). I doubt that
it matters in practice.
> - The client does not check that HTTP status code is either 200 or
> 304 when receiving response in discovering references phase.
We rely on curl's CURLOPT_FAILONERROR to handle errors. And curl handles
redirects internally. So yes, we could get a "204" or something weird,
but it would almost certainly not pass the other checks (proper
content-type, starting with pkt-line, etc). I doubt it's a problem in
practice.
We also handle 401 these days, which is not in the document, but
obviously makes sense to do (ditto for 407, but I cannot remember if we
actually handle that or not; there were patches, but I think they may
have been dropped).
> - The client verifies the first 5 bytes against pattern
> "^[0-9a-fA-F]{4}#" instead of "^[0-9a-f]{4}#" as described in
> section "discovering references".
I think this could be counted as "be liberal in what you accept",
although I do not know offhand of any implementations that use
uppercase. But if it is not true pkt-line we would figure it out pretty
quickly anyway.
> [...]
I read through the rest and did not see anything inaccurate. Thanks for
working on this.
-Peff
next prev parent reply other threads:[~2013-08-21 22:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 13:45 [PATCH] Document the HTTP transport protocols Nguyễn Thái Ngọc Duy
2013-08-21 18:45 ` Junio C Hamano
2013-08-21 22:00 ` Jeff King [this message]
2013-08-22 11:27 ` Duy Nguyen
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=20130821220021.GA32130@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=pclouds@gmail.com \
--cc=rctay89@gmail.com \
--cc=spearce@spearce.org \
/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).