Unverified Commit 8947e129 authored by Magali Ruffier's avatar Magali Ruffier Committed by GitHub
Browse files

Merge pull request #71 from Ensembl/master_ftp_support

porting of PR 70 to master
parents 85a3c136 a3c68272
......@@ -65,7 +65,7 @@ sub chase_redirects {
my $ua = LWP::UserAgent->new( max_redirect => $args->{'max_follow'} );
$ua->timeout(10);
$ua->env_proxy;
$ua->proxy([qw(http https)], $proxy) || ();
$ua->proxy([qw(http https ftp)], $proxy) || ();
my $response = $ua->head($url);
if ($response->is_success) {
return $response->request->uri->as_string;
......@@ -140,7 +140,7 @@ sub file_exists {
my $ua = LWP::UserAgent->new();
$ua->timeout(10);
$ua->env_proxy;
$ua->proxy([qw(http https)], $proxy) || ();
$ua->proxy([qw(http https ftp)], $proxy) || ();
my $response = $ua->head($url);
unless ($response->is_success) {
$error = _get_lwp_useragent_error($response);
......@@ -213,7 +213,7 @@ sub read_file {
my $ua = LWP::UserAgent->new();
$ua->timeout(10);
$ua->env_proxy;
$ua->proxy([qw(http https)], $proxy) || ();
$ua->proxy([qw(http https ftp)], $proxy) || ();
my $response = $ua->$method($url, %{$args->{'headers'}});
if ($response->is_success) {
$content = $response->content;
......@@ -337,7 +337,7 @@ sub fetch_file {
$ua->timeout(10);
$ua->env_proxy;
$ua->proxy([qw(http https)], $proxy) || ();
$ua->proxy([qw(http https ftp)], $proxy) || ();
my $dest = $args->{'destination_path'} ? $args->{'destination_path'}."$filename" : "/tmp/$filename";
my $response = $ua->mirror($file_url, $dest);
......
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