Re: Git-aware HTTP transport
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- Aug 26, 2008, 14:58 UTC
- Message-ID
- <20080826145857.GF26523@spearce.org>
- In-Reply-To
- <48B36BCA.8060103@zytor.com>
"H. Peter Anvin" <hpa@zytor.com> wrote:
Show 6 quoted lines
>> Detecting Smart Servers >> ----------------------- >> >> HTTP clients can detect a smart Git-aware server by HEADing >> $repo/backend.git-http and looking for a 302 redirect to the >> repository's smart service URL:
...
Show 9 quoted lines
>> All subsequent communcation for this transaction is done through >> the smart service URL ($ssurl), not the original URL. > > I actually suggest embedding the forwarding URL into an ordinary > payload. Instead of a HEAD request here, then do a GET (or, even > better, POST) and get the redirected URL in return. > > Why? Because it's common enough to redirect entire trees, and use of > HTTP-layer redirections here is an unnecessary layering violation.
Hmm. I'm actually thinking the exact opposite here. My rationale for putting the response as a standard HTTP 302/303 style redirect is to permit hardware load balancers or Apache mod_rewrite rules to implement simple load balancing with a HTTP redirect.
If we embed the redirect URL into the payload then configuring that will become a lot more complex. At the minimum you may have to make up a dummy file for each server (holding the response payload) then then let mod_rewrite rewrite the request internally to make Apache serve that file. Ugly.
> If you insist on using a HTTP status code, I would claim that 303 is a > better status code.
Ok.
-- Shawn.