Re: [PATCH] http: Support sending custom HTTP headers
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Apr 27, 2016, 11:56 UTC
- Message-ID
- <alpine.DEB.2.20.1604271355350.2896@virtualbox>
- In-Reply-To
- <20160427075219.GA32535@sigill.intra.peff.net>
Hi Peff,
On Wed, 27 Apr 2016, Jeff King wrote:
Show 22 quoted lines
> On Wed, Apr 27, 2016 at 08:31:50AM +0200, Johannes Schindelin wrote: > > > > +test_expect_success 'custom http headers' ' > > > + test_must_fail git fetch "$HTTPD_URL/smart_headers/repo.git" && > > > + git -c http.extraheader="x-magic-one: abra" \ > > > + -c http.extraheader="x-magic-two: cadabra" \ > > > + fetch "$HTTPD_URL/smart_headers/repo.git" > > > +' > > > + > > > stop_httpd > > > test_done > > > > That's pretty easy. > > > > After sleeping over the issue, I realized, though, that the test can use > > the very same method *I* used to verify that the headers are sent: using > > GIT_CURL_VERBOSE. > > > > I hope you do not mind that I used this method instead. > > TBH, I think mine is a little more robust, but I don't overly care > either way.
Yes, you are correct, I only test that the header is sent twice, assuming that exactly two HTTP requests are sent. Your test verifies that whatever request is sent *requires* the header.
Will send out v4 with your test instead of mine in a few moments.
Thanks, Dscho