diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-09-23 13:44:47 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-09-23 13:44:47 -0700 |
commit | cabb41d0f6c93077229502e7c2d57397808393c8 (patch) | |
tree | 3f9c68ee1088111dd8c77eb538f43c9714748aea /http-backend.c | |
parent | b5866edf97c19bea2b0557beeaec4223ad54e202 (diff) | |
parent | 1b421e7a5aa6984777029ab799f9a0221875e1dd (diff) | |
download | git-cabb41d0f6c93077229502e7c2d57397808393c8.tar.gz |
Merge branch 'jk/http-server-protocol-versions'
Taking advantage of the CGI interface, http-backend has been
updated to enable protocol v2 automatically when the other side
asks for it.
* jk/http-server-protocol-versions:
docs/protocol-v2: point readers transport config discussion
docs/git: discuss server-side config for GIT_PROTOCOL
docs/http-backend: mention v2 protocol
http-backend: handle HTTP_GIT_PROTOCOL CGI variable
t5551: test v2-to-v0 http protocol fallback
Diffstat (limited to 'http-backend.c')
-rw-r--r-- | http-backend.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/http-backend.c b/http-backend.c index 838374edb9..e7c0eeab23 100644 --- a/http-backend.c +++ b/http-backend.c @@ -739,6 +739,7 @@ static int bad_request(struct strbuf *hdr, const struct service_cmd *c) int cmd_main(int argc, const char **argv) { char *method = getenv("REQUEST_METHOD"); + const char *proto_header; char *dir; struct service_cmd *cmd = NULL; char *cmd_arg = NULL; @@ -789,6 +790,9 @@ int cmd_main(int argc, const char **argv) http_config(); max_request_buffer = git_env_ulong("GIT_HTTP_MAX_REQUEST_BUFFER", max_request_buffer); + proto_header = getenv("HTTP_GIT_PROTOCOL"); + if (proto_header) + setenv(GIT_PROTOCOL_ENVIRONMENT, proto_header, 0); cmd->imp(&hdr, cmd_arg); return 0; |