http: enable keep_error for HTTP requests

curl stops parsing a response when it sees a bad HTTP status code and it
has CURLOPT_FAILONERROR set. This prevents GIT_CURL_VERBOSE to show HTTP
headers on error.

keep_error is an option to receive the HTTP response body for those
error responses. By enabling this option, curl will process the HTTP
response headers, and they're shown if GIT_CURL_VERBOSE is set.

Signed-off-by: Masaya Suzuki <masayasuzuki@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Masaya Suzuki
2019-01-10 11:33:47 -08:00
committed by Junio C Hamano
parent 8dd2e88a92
commit e6cf87b12d
3 changed files with 19 additions and 25 deletions

1
http.h
View File

@@ -146,7 +146,6 @@ extern char *get_remote_object_url(const char *url, const char *hex,
/* Options for http_get_*() */
struct http_get_options {
unsigned no_cache:1,
keep_error:1,
initial_request:1;
/* If non-NULL, returns the content-type of the response. */