wilzbach / msa

Modular BioJS compoment for a multiple sequence alignment
http://msa.biojs.net
Boost Software License 1.0
168 stars 79 forks source link

crossorigin.me is being invoked even for relative URLs #189

Closed guidorice closed 8 years ago

guidorice commented 8 years ago

In my options for msa view, I am setting importURL: 'public/data/test.fasta'. This is a relative url on the same (private) webserver. But msa is trying to use a proxy apparently and using crossorigin.me.

guidorice commented 8 years ago

Actually, it it's not just relative urls, is also trying to fetch urls like: http://crossorigin.me/http://localhost:8080/public/data/test.fasta

using build 1.0.0 downloaded from github.

guidorice commented 8 years ago

Aha, I found that if I prefix the url then it works './public/data/test.fasta'

wilzbach commented 8 years ago

In my options for msa view, I am setting importURL: 'public/data/test.fasta'. This is a relative url on the same (private) webserver. But msa is trying to use a proxy apparently and using crossorigin.me.

Yeah the problem is that the code is pretty dumb and it's quite hard to distinguish between public-service.org/test and public/data/test.fasta without encoding common TLDs into the Viewer, hence only ./ and / are only used without a proxy.

Btw you also always set config.importProxy to an empty string if you want to avoid the proxy use at all or supply your own CORS proxy.

For more details: https://github.com/wilzbach/msa/blob/master/src/utils/proxy.js#L10