Skip to content

Commit 8efa5f6

Browse files
spearcegitster
authored andcommitted
remote-curl: Fix Accept header for smart HTTP connections
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fbb9971 commit 8efa5f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

remote-curl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int rpc_service(struct rpc_state *rpc, struct discovery *heads)
480480
strbuf_addf(&buf, "Content-Type: application/x-%s-request", svc);
481481
rpc->hdr_content_type = strbuf_detach(&buf, NULL);
482482

483-
strbuf_addf(&buf, "Accept: application/x-%s-response", svc);
483+
strbuf_addf(&buf, "Accept: application/x-%s-result", svc);
484484
rpc->hdr_accept = strbuf_detach(&buf, NULL);
485485

486486
while (!err) {

t/t5551-http-fetch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cat >exp <<EOF
3838
> POST /smart/repo.git/git-upload-pack HTTP/1.1
3939
> Accept-Encoding: deflate, gzip
4040
> Content-Type: application/x-git-upload-pack-request
41-
> Accept: application/x-git-upload-pack-response
41+
> Accept: application/x-git-upload-pack-result
4242
> Content-Length: xxx
4343
< HTTP/1.1 200 OK
4444
< Pragma: no-cache

0 commit comments

Comments
 (0)