Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ensembl-gh-mirror
ensembl-io
Commits
8947e129
Unverified
Commit
8947e129
authored
Dec 17, 2018
by
Magali Ruffier
Committed by
GitHub
Dec 17, 2018
Browse files
Merge pull request #71 from Ensembl/master_ftp_support
porting of PR 70 to master
parents
85a3c136
a3c68272
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
modules/EnsEMBL/Web/File/Utils/URL.pm
modules/EnsEMBL/Web/File/Utils/URL.pm
+4
-4
No files found.
modules/EnsEMBL/Web/File/Utils/URL.pm
View file @
8947e129
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment