Re: [PATCH v2] http: support sending custom HTTP headers
- From
Jeff King <peff@peff.net>
- Date
- Apr 26, 2016, 17:44 UTC
- Message-ID
- <20160426174418.GC7609@sigill.intra.peff.net>
- In-Reply-To
- <xmqq4maoi8x8.fsf@gitster.mtv.corp.google.com>
On Tue, Apr 26, 2016 at 10:20:19AM -0700, Junio C Hamano wrote:
Show 10 quoted lines
> Jeff King <peff@peff.net> writes: > > > But I think this block (even before my patch) also needs to handle the > > case where "value" is NULL (presumably by complaining with > > config_error_nonbool). > > OK, so squashes found to be necessary so far amounts to the attached > patch. I still haven't figured out the best way to rephrase the "by > default" in the proposed log message that made me stutter while > reading it, though.
I think that part is just trying to explain the implementation hackery. Maybe something like:
Note that `curl_easy_setopt(..., CURLOPT_HTTPHEADER, ...)` takes only a single list, overriding any previous call. This means we have to collect _all_ of the headers we want to use into a single list, and feed it to curl in one shot. Since we already unconditionally set a "pragma" header when initializing the curl handles, we can add our new headers to that list.
For callers which override the default header list (like probe_rpc), we provide `http_copy_default_headers()` so they can do the same trick.
-Peff