{"thread":{"id":"22182","subject":"[PATCH] remote-curl: Fix Accept header for smart HTTP connections","startedAt":"2010-01-12T17:54:04Z","lastAt":"2010-01-13T06:55:56Z","messageCount":2,"participants":["Shawn O. Pearce","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"131393","messageId":"20100112175404.GE1173@spearce.org","threadId":"22182","inReplyTo":null,"subject":"[PATCH] remote-curl: Fix Accept header for smart HTTP connections","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2010-01-12T17:54:04Z","receivedAt":"2010-01-12T17:54:04Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"We actually expect to see an application/x-git-upload-pack-result\nbut we lied and said we Accept *-response.  This was a typo on my\npart when I was writing the code.\n\nFortunately the wrong Accept header had no real impact, as the\ndeployed git-http-backend servers were not testing the Accept\nheader before they returned their content.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n This should go in maint.\n\n remote-curl.c         |    2 +-\n t/t5551-http-fetch.sh |    2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex a331bae..8f169dd 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -480,7 +480,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)\n \tstrbuf_addf(&buf, \"Content-Type: application/x-%s-request\", svc);\n \trpc->hdr_content_type = strbuf_detach(&buf, NULL);\n \n-\tstrbuf_addf(&buf, \"Accept: application/x-%s-response\", svc);\n+\tstrbuf_addf(&buf, \"Accept: application/x-%s-result\", svc);\n \trpc->hdr_accept = strbuf_detach(&buf, NULL);\n \n \twhile (!err) {\ndiff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh\nindex c0505ec..7faa31a 100755\n--- a/t/t5551-http-fetch.sh\n+++ b/t/t5551-http-fetch.sh\n@@ -38,7 +38,7 @@ cat >exp <<EOF\n > POST /smart/repo.git/git-upload-pack HTTP/1.1\n > Accept-Encoding: deflate, gzip\n > Content-Type: application/x-git-upload-pack-request\n-> Accept: application/x-git-upload-pack-response\n+> Accept: application/x-git-upload-pack-result\n > Content-Length: xxx\n < HTTP/1.1 200 OK\n < Pragma: no-cache\n-- \n1.6.6.280.ge295b\n\n-- \nShawn.\n"},{"id":"131428","messageId":"7v7hrmtrwj.fsf@alter.siamese.dyndns.org","threadId":"22182","inReplyTo":"20100112175404.GE1173@spearce.org","subject":"Re: [PATCH] remote-curl: Fix Accept header for smart HTTP connections","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-01-13T06:55:56Z","receivedAt":"2010-01-13T06:55:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks.\n"}]}