<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/lib-httpd, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-05-17T21:38:35Z</updated>
<entry>
<title>Merge branch 'js/http-custom-headers'</title>
<updated>2016-05-17T21:38:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-17T21:38:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=848b99b14e5287b492f095ca1ca6bce270880015'/>
<id>urn:sha1:848b99b14e5287b492f095ca1ca6bce270880015</id>
<content type='text'>
Update tests for "http.extraHeaders=&lt;header&gt;" to be portable back
to Apache 2.2 (the original depended on &lt;RequireAll/&gt; which is a
more recent feature).

* js/http-custom-headers:
  submodule: ensure that -c http.extraheader is heeded
  t5551: make the test for extra HTTP headers more robust
  tests: adjust the configuration for Apache 2.2
</content>
</entry>
<entry>
<title>tests: adjust the configuration for Apache 2.2</title>
<updated>2016-05-10T17:27:42Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-05-09T05:59:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1f2b45be0a2b205fc07758e0f4e9c13e90d34d9'/>
<id>urn:sha1:f1f2b45be0a2b205fc07758e0f4e9c13e90d34d9</id>
<content type='text'>
Lars Schneider noticed that the configuration introduced to test the
extra HTTP headers cannot be used with Apache 2.2 (which is still
actively maintained, as pointed out by Junio Hamano).

To let the tests pass with Apache 2.2 again, let's substitute the
offending &lt;RequireAll&gt; and `expr` by using old school RewriteCond
statements.

As RewriteCond does not allow testing for *non*-matches, we simply match
the desired case first and let it pass by marking the RewriteRule as
'[L]' ("last rule, do not process any other matching RewriteRules after
this"), and then have another RewriteRule that matches all other cases
and lets them fail via '[F]' ("fail").

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Tested-by: Lars Schneider &lt;larsxschneider@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'js/http-custom-headers'</title>
<updated>2016-05-06T21:45:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-06T21:45:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e250f495b248ec0bbe493e40c98a10414cfa1eef'/>
<id>urn:sha1:e250f495b248ec0bbe493e40c98a10414cfa1eef</id>
<content type='text'>
HTTP transport clients learned to throw extra HTTP headers at the
server, specified via http.extraHeader configuration variable.

* js/http-custom-headers:
  http: support sending custom HTTP headers
</content>
</entry>
<entry>
<title>http: support sending custom HTTP headers</title>
<updated>2016-04-27T21:02:33Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2016-04-27T12:20:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8cb01e2fd3a50b6d0893dfb066183f16a3c7a355'/>
<id>urn:sha1:8cb01e2fd3a50b6d0893dfb066183f16a3c7a355</id>
<content type='text'>
We introduce a way to send custom HTTP headers with all requests.

This allows us, for example, to send an extra token from build agents
for temporary access to private repositories. (This is the use case that
triggered this patch.)

This feature can be used like this:

	git -c http.extraheader='Secret: sssh!' fetch $URL $REF

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.

Big thanks to Jeff King and Junio Hamano for their outstanding help and
patient reviews.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/test-httpd-config-nosystem'</title>
<updated>2016-04-06T18:39:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-04-06T18:39:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e95e47c5d0a09593c9a9ac50f84d04de577c6b0'/>
<id>urn:sha1:3e95e47c5d0a09593c9a9ac50f84d04de577c6b0</id>
<content type='text'>
The tests that involve running httpd leaked the system-wide
configuration in /etc/gitconfig to the tested environment.

* jk/test-httpd-config-nosystem:
  t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env
</content>
</entry>
<entry>
<title>t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env</title>
<updated>2016-03-18T22:37:58Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-03-16T00:56:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fad5033ad664e617eb05f778c83c1a75bddc8d8'/>
<id>urn:sha1:1fad5033ad664e617eb05f778c83c1a75bddc8d8</id>
<content type='text'>
We set GIT_CONFIG_NOSYSTEM in our test scripts so that we do
not accidentally read /etc/gitconfig and have it influence
the outcome of the tests. But when running smart-http tests,
Apache will clean the environment, including this variable,
and the "server" side of our http operations will read it.

You can see this breakage by doing something like:

  make
  ./git config --system http.getanyfile false
  make test

which will cause t5561 to fail when it tests the
fallback-to-dumb operation.

We can fix this by instructing Apache to pass through the
variable. Unlike with other variables (e.g., 89c57ab3's
GIT_TRACE), we don't need to set a dummy value to prevent
warnings from Apache. test-lib.sh already makes sure that
GIT_CONFIG_NOSYSTEM is set and exported.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t/lib-httpd: load mod_unixd</title>
<updated>2016-02-25T23:25:16Z</updated>
<author>
<name>Michael J Gruber</name>
<email>git@drmicha.warpmail.net</email>
</author>
<published>2015-05-11T11:54:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=59223223f478b291c6dbe59ca0bca3c6178da7a0'/>
<id>urn:sha1:59223223f478b291c6dbe59ca0bca3c6178da7a0</id>
<content type='text'>
In contrast to apache 2.2, apache 2.4 does not load mod_unixd in its
default configuration (because there are choices). Thus, with the
current config, apache 2.4.10 will not be started and the httpd tests
will not run on distros with default apache config (RedHat type).

Enable mod_unixd to make the httpd tests run. This does not affect
distros negatively which have that config already in their default
(Debian type). httpd tests will run on these before and after this patch.

Signed-off-by: Michael J Gruber &lt;git@drmicha.warpmail.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: limit redirection depth</title>
<updated>2015-09-25T22:32:28Z</updated>
<author>
<name>Blake Burkhart</name>
<email>bburky@bburky.com</email>
</author>
<published>2015-09-22T22:06:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b258116462399b318c86165c61a5c7123043cfd4'/>
<id>urn:sha1:b258116462399b318c86165c61a5c7123043cfd4</id>
<content type='text'>
By default, libcurl will follow circular http redirects
forever. Let's put a cap on this so that somebody who can
trigger an automated fetch of an arbitrary repository (e.g.,
for CI) cannot convince git to loop infinitely.

The value chosen is 20, which is the same default that
Firefox uses.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>http: limit redirection to protocol-whitelist</title>
<updated>2015-09-25T22:30:39Z</updated>
<author>
<name>Blake Burkhart</name>
<email>bburky@bburky.com</email>
</author>
<published>2015-09-22T22:06:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f4113cac0c88b4f36ee6f3abf3218034440a68e3'/>
<id>urn:sha1:f4113cac0c88b4f36ee6f3abf3218034440a68e3</id>
<content type='text'>
Previously, libcurl would follow redirection to any protocol
it was compiled for support with. This is desirable to allow
redirection from HTTP to HTTPS. However, it would even
successfully allow redirection from HTTP to SFTP, a protocol
that git does not otherwise support at all. Furthermore
git's new protocol-whitelisting could be bypassed by
following a redirect within the remote helper, as it was
only enforced at transport selection time.

This patch limits redirects within libcurl to HTTP, HTTPS,
FTP and FTPS. If there is a protocol-whitelist present, this
list is limited to those also allowed by the whitelist. As
redirection happens from within libcurl, it is impossible
for an HTTP redirect to a protocol implemented within
another remote helper.

When the curl version git was compiled with is too old to
support restrictions on protocol redirection, we warn the
user if GIT_ALLOW_PROTOCOL restrictions were requested. This
is a little inaccurate, as even without that variable in the
environment, we would still restrict SFTP, etc, and we do
not warn in that case. But anything else means we would
literally warn every time git accesses an http remote.

This commit includes a test, but it is not as robust as we
would hope. It redirects an http request to ftp, and checks
that curl complained about the protocol, which means that we
are relying on curl's specific error message to know what
happened. Ideally we would redirect to a working ftp server
and confirm that we can clone without protocol restrictions,
and not with them. But we do not have a portable way of
providing an ftp server, nor any other protocol that curl
supports (https is the closest, but we would have to deal
with certificates).

[jk: added test and version warning]

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t: pass GIT_TRACE through Apache</title>
<updated>2015-03-13T06:25:06Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-03-13T04:51:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89c57ab3f0168b192d5ccc159972fdb26e0ba80b'/>
<id>urn:sha1:89c57ab3f0168b192d5ccc159972fdb26e0ba80b</id>
<content type='text'>
Apache removes GIT_TRACE from the environment before running
git-http-backend. This can make it hard to debug the server
side of an http session. Let's let it through.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
