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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonathan Nieder wrote:
> Josh Steadmon wrote:

>> HTTP servers return 400 if you send headers before the GET request.
[...]
> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux