Skip to content

Commit

Permalink
t5551-http-fetch: Work around broken Accept header in libcurl
Browse files Browse the repository at this point in the history
Unfortunately at least one version of libcurl has a bug causing
it to include "Accept: */*" in the same POST request where we have
already asked for "Accept: application/x-git-upload-pack-response".

This is a bug in libcurl, not Git, or our test vector.  The
application has explicitly asked the server for a single content
type, but libcurl has mistakenly also told the server the client
application will accept */*, which is any content type.

Based on the libcurl change log, this "Accept: */*" header bug
may have been fixed in version 7.18.1 released March 30, 2008:

  http://curl.haxx.se/changes.html#7_18_1

Rather than require users to upgrade libcurl we change the test
vector to trim this line out of the 2nd request.

Reported-by: Tarmigan <tarmigan+git@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Nov 10, 2009
1 parent 0a8fcbd commit 2036663
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions t/t5551-http-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ test_expect_success 'clone http repository' '
/^> User-Agent: /d
/^> Host: /d
/^> POST /,$ {
/^> Accept: [*]\\/[*]/d
}
s/^> Content-Length: .*/> Content-Length: xxx/
/^> 00..want /d
/^> 00.*done/d
Expand Down

0 comments on commit 2036663

Please sign in to comment.