git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] protocol-v2 doc: put HTTP headers after request

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jun 22, 2018, 20:47 UTC
Message-ID
<20180622204722.GG12013@aiede.svl.corp.google.com>
In-Reply-To
<20180622193757.GF12013@aiede.svl.corp.google.com>
Jonathan Nieder wrote:
> Josh Steadmon wrote:
>> HTTP servers return 400 if you send headers before the GET request.
[...]
Show 12 quoted lines
> Tested using
>
>   openssl s_client -connect github.com:443
>
> with input
>
>   GET /git/git/info/refs?service=git-upload-pack HTTP/1.0
>   Host: github.com
>   Git-Protocol: version=2
>
> which produces a 404 instead of the 400 that putting Git-Protocol
> in front would produce.
I figured out how to produce a 200:
	printf '%s\r\n' \
		'GET /git/git/info/refs?service=git-upload-pack HTTP/1.0' \
		'Host: github.com' \
		'User-Agent: git/jrn-at-keyboard' \
		'Git-Protocol: version=2' '' |
	openssl s_client -connect github.com:443 -quiet
The critical part is the User-Agent starting with git/.

So we should probably update Documentation/technical/http-protocol.txt to indicate that clients MUST have a user-agent string starting with Git/ to allow the kind of request routing that github does.

That's all orthogonal to this patch.  The patch still looks good to me.

Sincerely, Jonathan

Previous: Jonathan Nieder
Message 3 of 3 in “protocol-v2 doc: put HTTP headers after request”
  1. protocol-v2 doc: put HTTP headers after requestJosh Steadmon, Jun 22, 2018
  2. Jonathan NiederJun 22, 2018
  3. Jonathan NiederJun 22, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.