From: Jonathan Nieder <jrnieder@gmail.com>
To: Josh Steadmon <steadmon@google.com>
Cc: git@vger.kernel.org, bmwill@google.com
Subject: Re: [PATCH] protocol-v2 doc: put HTTP headers after request
Date: Fri, 22 Jun 2018 13:47:22 -0700 [thread overview]
Message-ID: <20180622204722.GG12013@aiede.svl.corp.google.com> (raw)
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.
[...]
> 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
prev parent reply other threads:[~2018-06-22 20:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-22 19:01 [PATCH] protocol-v2 doc: put HTTP headers after request Josh Steadmon
2018-06-22 19:37 ` Jonathan Nieder
2018-06-22 20:47 ` Jonathan Nieder [this message]
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=20180622204722.GG12013@aiede.svl.corp.google.com \
--to=jrnieder@gmail.com \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=steadmon@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox