Re: Git-aware HTTP transport
- From
Mike Hommey <mh@glandium.org>
- Date
- Aug 28, 2008, 18:04 UTC
- Message-ID
- <20080828180452.GB14901@glandium.org>
- In-Reply-To
- <alpine.DEB.1.10.0808281033070.2713@asgard.lang.hm>
On Thu, Aug 28, 2008 at 10:37:04AM -0700, david@lang.hm wrote:
Show 25 quoted lines
> On Thu, 28 Aug 2008, Shawn O. Pearce wrote: > >> david@lang.hm wrote: >>> On Thu, 28 Aug 2008, Shawn O. Pearce wrote: >>>>> "Shawn O. Pearce" <spearce@spearce.org> writes: >>>> >>>> Yes, I really did mean for this part of the protocol to be in binary. >>> >>> except that HTTP cannot transport binary data, if you feed it binary data >>> it then encodes it into 7-bit safe forms for transport. >> >> So then how does it transport a GIF file to my browser? uuencoded? > > something like that. it uses the mimetype mechanisms to identify the > various pieces and encodes each piece (if nothing else it needs to make > sure that the mimetype seperators don't appear in the data) uuencode is > one of the available mechanisms. > >> Last time I read the RFCs I was pretty certain HTTP is 8-bit clean >> in both directions. > > I could be wrong, but I'm pretty sure I'm not. to test this yourself find > a webserver with an image file and retrieve it via telnet (telnet > hostname 80<enter>GET /path/to/file HTTP/1.0<enter><enter>) and what will > come back will be text.
No it won't. Try it *yourself*.
$ nc www.google.com 80 | sed '1,/^\r$/d' > /tmp/logo.gif GET /intl/en_ALL/images/logo.gif HTTP/1.1 Host: www.google.com Connection: close
$ file /tmp/logo.gif /tmp/logo.gif: GIF image data, version 89a, 276 x 110
Mike
PS: sed only removes the HTTP response headers.