All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: Joshua Juran <jjuran@gmail.com>
Cc: "Jakub Narebski" <jnareb@gmail.com>,
	"Sitaram Chamarty" <sitaramc@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Ilari Liusvaara" <ilari.liusvaara@elisanet.fi>,
	"Jonathan Nieder" <jrnieder@gmail.com>,
	git@vger.kernel.org, "Tarmigan Casebolt" <tarmigan+git@gmail.com>
Subject: Re: [PATCH] Add ERR support to smart HTTP
Date: Mon, 6 Sep 2010 07:56:06 -0700	[thread overview]
Message-ID: <20100906145606.GM32601@spearce.org> (raw)
In-Reply-To: <EC704F6E-3075-459C-9210-10C234523D80@gmail.com>

Joshua Juran <jjuran@gmail.com> wrote:
> On Sep 6, 2010, at 1:49 AM, Jakub Narebski wrote:
>>
>> From what I remember from smart HTTP discussion (during fleshing-out
>> the protocol/exchange details), the fact that errors from git are send
>> with "200 OK" HTTP status are very much conscious decision.  But I  
>> don't
>> remember *why* it was chosen this way.  If I remember correctly it was
>> something about transparent proxies and caches...  Is it documented
>> anywhere?  Can anyone explain it?
>
> I wasn't involved in the decision process, but I suspect it's because  
> HTTP is the transport layer to the Git application.  It's the same logic 
> as trying to log in to a Web application with bogus credentials and 
> getting back a page (HTTP 200 OK) stating that the login failed.  As far 
> as HTTP is concerned, the transaction succeeded.

Exactly correct.

FWIW, I meant for the standard git:// ERR type error to be used
here under smart-HTTP.  I'm not sure why we need Ilari's original
patch at all.

That is, the following will trigger a correct error on the client:

  200 OK
  Content-Type: application/x-git-upload-pack-advertisement

  001e# service=git-upload-pack
  0022ERR You shall not do this

Likewise if you wanted to do this with receive-pack, replace upload
with receive above and adjust the pkt-line lengths.

The initial # service= packet is as much part of the "transport
layer" as the HTTP 200 OK response is.  Its the server saying "Yup,
I understood your request correctly.  Now here is your error."

Translation is, gitolite (or GitHub, or ...) should be sending back
two pkt-lines under smart HTTP, not one.

-- 
Shawn.

  reply	other threads:[~2010-09-06 14:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-05 17:30 [PATCH] Add ERR support to smart HTTP Ilari Liusvaara
2010-09-05 17:41 ` Jonathan Nieder
2010-09-05 18:49   ` Ilari Liusvaara
2010-09-05 19:27     ` Ævar Arnfjörð Bjarmason
2010-09-05 21:21       ` Ilari Liusvaara
2010-09-05 21:22       ` Jakub Narebski
2010-09-06  1:04         ` Sitaram Chamarty
2010-09-06  5:45           ` Sitaram Chamarty
2010-09-06  8:45             ` Ævar Arnfjörð Bjarmason
2010-09-06  8:49             ` Jakub Narebski
2010-09-06  9:15               ` Joshua Juran
2010-09-06 14:56                 ` Shawn O. Pearce [this message]
2010-09-06 17:59                   ` Sitaram Chamarty
2010-09-06 18:19                     ` Shawn O. Pearce
2010-09-08 14:36                       ` Sitaram Chamarty
2010-09-06 14:24               ` Sitaram Chamarty
2010-09-06 16:31                 ` Jakub Narebski
2010-09-05 20:11     ` Jonathan Nieder

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=20100906145606.GM32601@spearce.org \
    --to=spearce@spearce.org \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ilari.liusvaara@elisanet.fi \
    --cc=jjuran@gmail.com \
    --cc=jnareb@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=sitaramc@gmail.com \
    --cc=tarmigan+git@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.