Re: [PATCH] http: Support sending custom HTTP headers

2016-04-27 Thread Johannes Schindelin
Hi Peff, On Wed, 27 Apr 2016, Jeff King wrote: > 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" \

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-27 Thread Jeff King
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"

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Johannes Schindelin
Hi Peff, On Tue, 26 Apr 2016, Jeff King wrote: > On Tue, Apr 26, 2016 at 05:33:33PM +0200, Johannes Schindelin wrote: > > > Testing the headers? I dunno, do we have tests for that already? I thought > > we did not: it requires an HTTP server (so that the headers are actually > > sent) that we ca

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Jeff King
On Tue, Apr 26, 2016 at 05:33:33PM +0200, Johannes Schindelin wrote: > Testing the headers? I dunno, do we have tests for that already? I thought > we did not: it requires an HTTP server (so that the headers are actually > sent) that we can force to check the header... > > So I see we have some t

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Jeff King
On Tue, Apr 26, 2016 at 05:37:32PM +0200, Johannes Schindelin wrote: > > I think that's really the only sane way to do it because of curl's > > interfaces. But maybe it is worth a comment either here, or along with > > http_get_default_headers(), or both. > > I chose to rename it to http_copy_def

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Junio C Hamano
Johannes Schindelin writes: > Testing the headers? I dunno, do we have tests for that already? I thought > we did not: it requires an HTTP server (so that the headers are actually > sent) that we can force to check the header... > > So I see we have some tests that use Apache, and one that uses o

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Johannes Schindelin
Hi Peff, On Mon, 25 Apr 2016, Jeff King wrote: > On Mon, Apr 25, 2016 at 03:13:08PM +0200, Johannes Schindelin wrote: > > > diff --git a/http.c b/http.c > > index 4304b80..02d7147 100644 > > --- a/http.c > > +++ b/http.c > > @@ -114,6 +114,7 @@ static unsigned long http_auth_methods = CURLAUTH_A

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-26 Thread Johannes Schindelin
Hi Junio, On Mon, 25 Apr 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > To make communication for `git fetch`, `git ls-remote` and friends > > extra secure, we introduce a way to send custom HTTP headers with all > > requests. > > I think an ability to send custom headers may

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-25 Thread Junio C Hamano
Johannes Schindelin writes: > To make communication for `git fetch`, `git ls-remote` and friends extra > secure, we introduce a way to send custom HTTP headers with all > requests. I think an ability to send custom headers may be a good addition and have no problem with it, but I tend to agree w

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-25 Thread Jeff King
On Mon, Apr 25, 2016 at 03:13:08PM +0200, Johannes Schindelin wrote: > diff --git a/http.c b/http.c > index 4304b80..02d7147 100644 > --- a/http.c > +++ b/http.c > @@ -114,6 +114,7 @@ static unsigned long http_auth_methods = CURLAUTH_ANY; > > static struct curl_slist *pragma_header; > static s

Re: [PATCH] http: Support sending custom HTTP headers

2016-04-25 Thread Shawn Pearce
On Mon, Apr 25, 2016 at 6:13 AM, Johannes Schindelin wrote: > To make communication for `git fetch`, `git ls-remote` and friends extra > secure, we introduce a way to send custom HTTP headers with all > requests. Hmm. Its not Apr 1 2016. So I guess you are serious. :) > This allows us, for examp

[PATCH] http: Support sending custom HTTP headers

2016-04-25 Thread Johannes Schindelin
To make communication for `git fetch`, `git ls-remote` and friends extra secure, we introduce a way to send custom HTTP headers with all requests. This allows us, for example, to send an extra token that the server tests for. The server could use this token e.g. to ensure that only certain operati