[PATCH v2 0/2] Show HTTP headers of failed requests with GIT_CURL_VERBOSE
- From
Masaya Suzuki <masayasuzuki@google.com>
- Date
- Dec 29, 2018, 19:44 UTC
- Message-ID
- <20181229194447.157763-1-masayasuzuki@google.com>
- In-Reply-To
- <20181228014720.206443-1-masayasuzuki@google.com>
When GIT_CURL_VERBOSE is set, libcurl produces request/response headers to stderr. However, if the response is an error response and CURLOPT_FAILONERROR is set, libcurl stops parsing the response, and it won't dump the headers. Showing HTTP response headers is useful for debugging, especially for non-OK responses.
To this end, the caller of libcurl needs to handle HTTP request failures by themselves. The first patch makes git prepared to handle those failures. The second patch actually unsets CURLOPT_FAILONERROR.
Masaya Suzuki (2): Change how HTTP response body is returned Unset CURLOPT_FAILONERROR
http.c | 103 +++++++++++++++++++---------------- http.h | 1 - remote-curl.c | 30 ++++++++-- t/lib-httpd/apache.conf | 1 + t/t5581-http-curl-verbose.sh | 28 ++++++++++ 5 files changed, 110 insertions(+), 53 deletions(-) create mode 100755 t/t5581-http-curl-verbose.sh
-- 2.20.1.415.g653613c723-goog