From 237ffedd46098a5b8a303cfbac7ecb0ff3a8a7a7 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 15 Mar 2018 10:31:40 -0700 Subject: http: eliminate "# service" line when using protocol v2 When an http info/refs request is made, requesting that protocol v2 be used, don't send a "# service" line since this line is not part of the v2 spec. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- http-backend.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'http-backend.c') diff --git a/http-backend.c b/http-backend.c index f3dc218b2a..5d241e9109 100644 --- a/http-backend.c +++ b/http-backend.c @@ -10,6 +10,7 @@ #include "url.h" #include "argv-array.h" #include "packfile.h" +#include "protocol.h" static const char content_type[] = "Content-Type"; static const char content_length[] = "Content-Length"; @@ -466,8 +467,11 @@ static void get_info_refs(struct strbuf *hdr, char *arg) hdr_str(hdr, content_type, buf.buf); end_headers(hdr); - packet_write_fmt(1, "# service=git-%s\n", svc->name); - packet_flush(1); + + if (determine_protocol_version_server() != protocol_v2) { + packet_write_fmt(1, "# service=git-%s\n", svc->name); + packet_flush(1); + } argv[0] = svc->name; run_service(argv, 0); -- cgit v1.2.3