From bbc8063258e22fb5270d27f3d5c74215c88a8785 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 8 Aug 2019 12:30:46 +0100 Subject: [PATCH] dgit: WWW::Curl Set $response_body to '' explicitly check_for_git calls url_fetch with a WWW::Curl parameter CURLOPT_NOBODY which suppresses saving the body. The result is that CURLOPT_WRITEDATA does not update $response_body. Then, even on success, url_fetch returns undef (which ought to mean 404). Strictly this is a bit sneaky of check_for_git. But, rather than trying to make this interface more formal, just make url_fetch set $response_body to ''. It does return this except in the success case, so the error cases are still handled right. Closes: #934126 Signed-off-by: Ian Jackson --- dgit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dgit b/dgit index d24c4e64..f7b5025f 100755 --- a/dgit +++ b/dgit @@ -1191,7 +1191,7 @@ sub url_fetch ($;@) { confess "$k $v ".$curl->strerror($x)." ?" if $x; }; - my $response_body; + my $response_body = ''; $setopt->(CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTPS|CURLPROTO_HTTP); $setopt->(CURLOPT_URL, $url); $setopt->(CURLOPT_NOSIGNAL, 1); -- 2.30.2