Unverified Commit 0f8df026 authored by Imran Salam's avatar Imran Salam Committed by GitHub
Browse files

Check response status code instead of message for file fetch requests

parent 92630dd2
......@@ -341,7 +341,7 @@ sub fetch_file {
my $dest = $args->{'destination_path'} ? $args->{'destination_path'}."$filename" : "/tmp/$filename";
my $response = $ua->mirror($file_url, $dest);
return $dest if ($response->{_msg} eq 'OK');
return $dest if ($response->{_rc} == 200);
if($args->{'nice'}) {
return {'error' => "Cannot download file ($file_url). HTTP request error code ".$response->{_rc}};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment