git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] remote-curl: Fix Accept header for smart HTTP connections

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 12, 2010, 17:54 UTC
Message-ID
<20100112175404.GE1173@spearce.org>

We actually expect to see an application/x-git-upload-pack-result but we lied and said we Accept *-response. This was a typo on my part when I was writing the code.

Fortunately the wrong Accept header had no real impact, as the deployed git-http-backend servers were not testing the Accept header before they returned their content.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
---
 This should go in maint.
 remote-curl.c         |    2 +-
 t/t5551-http-fetch.sh |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/remote-curl.c b/remote-curl.c
index a331bae..8f169dd 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -480,7 +480,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)
 	strbuf_addf(&buf, "Content-Type: application/x-%s-request", svc);
 	rpc->hdr_content_type = strbuf_detach(&buf, NULL);
 
-	strbuf_addf(&buf, "Accept: application/x-%s-response", svc);
+	strbuf_addf(&buf, "Accept: application/x-%s-result", svc);
 	rpc->hdr_accept = strbuf_detach(&buf, NULL);
 
 	while (!err) {
diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index c0505ec..7faa31a 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -38,7 +38,7 @@ cat >exp <<EOF
 > POST /smart/repo.git/git-upload-pack HTTP/1.1
 > Accept-Encoding: deflate, gzip
 > Content-Type: application/x-git-upload-pack-request
-> Accept: application/x-git-upload-pack-response
+> Accept: application/x-git-upload-pack-result
 > Content-Length: xxx
 < HTTP/1.1 200 OK
 < Pragma: no-cache
-- 
1.6.6.280.ge295b

-- 
Shawn.
Next: Junio C Hamano
Message 1 of 2 in “remote-curl: Fix Accept header for smart HTTP connections”
  1. remote-curl: Fix Accept header for smart HTTP connectionsShawn O. Pearce, Jan 12, 2010
  2. Junio C HamanoJan 13, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.