1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 05:56:30 +02:00
git/t/lib-httpd
Jeff King ff6a37c99e http-backend: handle HTTP_GIT_PROTOCOL CGI variable
When a client requests the v2 protocol over HTTP, they set the
Git-Protocol header. Webservers will generally make that available to
our CGI as HTTP_GIT_PROTOCOL in the environment. However, that's not
sufficient for upload-pack, etc, to respect it; they look in
GIT_PROTOCOL (without the HTTP_ prefix).

Either the webserver or the CGI is responsible for relaying that HTTP
header into the GIT_PROTOCOL variable. Traditionally, our tests have
configured the webserver to do so, but that's a burden on the server
admin. We can make this work out of the box by having the http-backend
CGI copy the contents of HTTP_GIT_PROTOCOL to GIT_PROTOCOL.

There are no new tests here. By removing the SetEnvIf line from our
test Apache config, we're now relying on this behavior of http-backend
to trigger the v2 protocol there (and there are numerous tests that fail
if this doesn't work).

There is one subtlety here: we copy HTTP_GIT_PROTOCOL only if there is
no existing GIT_PROTOCOL variable. That leaves the webserver admin free
to override the client's decision if they choose. This is unlikely to be
useful in practice, but is more flexible. And indeed, it allows the
v2-to-v0 fallback test added in the previous commit to continue working.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-10 15:34:59 -07:00
..
apache.conf http-backend: handle HTTP_GIT_PROTOCOL CGI variable 2021-09-10 15:34:59 -07:00
apply-one-time-perl.sh t/lib-httpd: avoid using macOS' sed 2020-02-27 09:58:41 -08:00
broken-smart-http.sh t/lib-httpd: use write_script to copy CGI scripts 2014-05-23 12:41:50 -07:00
error-smart-http.sh t5551: test server-side ERR packet 2019-02-06 12:20:23 -08:00
error.sh http: fix charset detection of extract_content_type() 2014-06-17 15:25:00 -07:00
incomplete-body-upload-pack-v2-http.sh remote-curl: error on incomplete packet 2020-05-24 16:26:00 -07:00
incomplete-length-upload-pack-v2-http.sh remote-curl: error on incomplete packet 2020-05-24 16:26:00 -07:00
passwd
ssl.cnf