genouest / biomaj-download

Download microservice for BioMAJ
GNU Affero General Public License v3.0
1 stars 7 forks source link

Multiple slashes make download problems #31

Closed braffes closed 4 years ago

braffes commented 4 years ago

As I see in both files : at the line 145 of downloadservice.py downloader = DirectHTTPDownload("https", server, '/' )

and at the line 334 of download/direct.py return self.url + '/' + rfile['root'] + rfile['name']

The minimum of slash number is 2 because rfile['root'] will always take the value "/", so in few website, there is a problem and the download doesn't work. Maybe I am wrong, and it is possible to change the value of rfile['root'] but I don't find the solution. I probably don't

For example in my configuration I have:

remote.file.1.protocol=directhttps remote.file.1.server=mothur.s3.us-east-2.amazonaws.com remote.file.1.path=wiki/findley_its_database.zip remote.file.1.name=Findley_ITS_database.zip

and the URL that is requested, is: https://mothur.s3.us-east-2.amazonaws.com//wiki/findley_its_database.zip

And we see the double slashes between .com and wiki.

Is a configuration possible to avoid this problem?

Thanks,

Brice

osallou commented 4 years ago

Hi, this should be fixed. Most of cases is not an issue, issue is onmy on s3 storage were path is not a real one but an object name, so in this case double slash is indeed an issue.

Will patch this soon

osallou commented 4 years ago

If everything is fine, should be fixed tomorrow

osallou commented 4 years ago

Fixes in biomaj-download 3.2.2 and docker osallou/biomaj-docker:shahiforma-v4

depending on your biomaj version, make sure to update all biomaj components