git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-3246 JAL-3247 Reworked JVL files as getdown.txt config with limitations
[jalview.git]
/
getdown
/
src
/
getdown
/
core
/
src
/
main
/
java
/
com
/
threerings
/
getdown
/
util
/
HostWhitelist.java
diff --git
a/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java
b/getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java
index
c05992a
..
f2f7ef3
100644
(file)
--- a/
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java
+++ b/
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/HostWhitelist.java
@@
-25,6
+25,8
@@
public final class HostWhitelist
*/
public static URL verify (URL url) throws MalformedURLException
{
*/
public static URL verify (URL url) throws MalformedURLException
{
+
+
return verify(Build.hostWhitelist(), url);
}
return verify(Build.hostWhitelist(), url);
}
@@
-41,6
+43,12
@@
public final class HostWhitelist
}
String urlHost = url.getHost();
}
String urlHost = url.getHost();
+ String protocol = url.getProtocol();
+
+ if (ALLOW_LOCATOR_FILE_PROTOCOL && protocol.equals("file") && urlHost.equals("")) {
+ return url;
+ }
+
for (String host : hosts) {
String regex = host.replace(".", "\\.").replace("*", ".*");
if (urlHost.matches(regex)) {
for (String host : hosts) {
String regex = host.replace(".", "\\.").replace("*", ".*");
if (urlHost.matches(regex)) {
@@
-51,4
+59,5
@@
public final class HostWhitelist
throw new MalformedURLException(
"The host for the specified URL (" + url + ") is not in the host whitelist: " + hosts);
}
throw new MalformedURLException(
"The host for the specified URL (" + url + ") is not in the host whitelist: " + hosts);
}
+ private static boolean ALLOW_LOCATOR_FILE_PROTOCOL = true;
}
}