mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
OPENIDE Add some links to WhiteListUrls
This commit is contained in:
@@ -61,7 +61,8 @@ object WhiteListUrls {
|
|||||||
"https://ls.store.amplicode.ru",
|
"https://ls.store.amplicode.ru",
|
||||||
"https://resources.openide.ru",
|
"https://resources.openide.ru",
|
||||||
"https://api.github.com",
|
"https://api.github.com",
|
||||||
"https://avatars.githubusercontent.com"
|
"https://avatars.githubusercontent.com",
|
||||||
|
"https://plugin.openbpm.ru"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Collect urls from KnownSchemaIdentifiers.json
|
// Collect urls from KnownSchemaIdentifiers.json
|
||||||
@@ -190,7 +191,8 @@ object WhiteListUrls {
|
|||||||
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun isAvailableUrl(url: String): Boolean {
|
fun isAvailableUrl(url: String): Boolean {
|
||||||
if (urls.startWith(url)
|
if (isLocalFile(url)
|
||||||
|
|| urls.startWith(url)
|
||||||
|| jsonSchemaUrls.startWith(url)
|
|| jsonSchemaUrls.startWith(url)
|
||||||
|| OpenIdePersistentUrlStorage.getInstance().getUrls().startWith(url)) {
|
|| OpenIdePersistentUrlStorage.getInstance().getUrls().startWith(url)) {
|
||||||
return true
|
return true
|
||||||
@@ -218,6 +220,10 @@ object WhiteListUrls {
|
|||||||
private fun List<String>.startWith(url: String): Boolean {
|
private fun List<String>.startWith(url: String): Boolean {
|
||||||
return this.any { url.startsWith(it, true) }
|
return this.any { url.startsWith(it, true) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun isLocalFile(url: String): Boolean {
|
||||||
|
return url.startsWith("file")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class StubUrlConnection(url: URL): URLConnection(url) {
|
class StubUrlConnection(url: URL): URLConnection(url) {
|
||||||
|
|||||||
Reference in New Issue
Block a user