From: hansonr Date: Sun, 11 Nov 2018 00:35:59 +0000 (-0600) Subject: adds static declaration of AJAX-readable domains X-Git-Tag: Release_2_11_4_0~45^2~18^2~420 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4c21d7730da7e3caf652d085718f3220a455067b;p=jalview.git adds static declaration of AJAX-readable domains --- diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index b6315f3..6d23bd0 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -1052,4 +1052,19 @@ public class Cache } } } + + /** + * Add a known domain that implements access-control-allow-origin:* bh 2018 + * + * @param defaultUniprotDomain + */ + public static void addJ2SDirectDatabaseCall(String domain) + { + + /** + * @j2sNative + * + * J2S.addDirectDatabaseCall(domain); + */ + } } diff --git a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java index b4100cb..c3ca893 100644 --- a/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java +++ b/src/jalview/fts/service/uniprot/UniProtFTSRestClient.java @@ -47,6 +47,10 @@ public class UniProtFTSRestClient extends FTSRestClient { private static final String DEFAULT_UNIPROT_DOMAIN = "https://www.uniprot.org"; + static { + Cache.addJ2SDirectDatabaseCall(DEFAULT_UNIPROT_DOMAIN); + } + private static FTSRestClientI instance = null; public final String uniprotSearchEndpoint; @@ -55,7 +59,7 @@ public class UniProtFTSRestClient extends FTSRestClient { super(); uniprotSearchEndpoint = Cache.getDefault("UNIPROT_DOMAIN", - DEFAULT_UNIPROT_DOMAIN) + "/uniprot/"; + DEFAULT_UNIPROT_DOMAIN) + "/uniprot/"; } @Override