Appearance
KBE3D / KBCore / Cesium / TrustedServers / contains
函数: contains()
contains(
url:string):boolean
Tests whether a server is trusted or not. The server must have been added with the port if it is included in the url.
参数
url
string
The url to be tested against the trusted list
返回
boolean
Returns true if url is trusted, false otherwise.
示例
ts
// Add server
TrustedServers.add('my.server.com', 81);
// Check if server is trusted
if (TrustedServers.contains('https://my.server.com:81/path/to/file.png')) {
// my.server.com:81 is trusted
}
if (TrustedServers.contains('https://my.server.com/path/to/file.png')) {
// my.server.com isn't trusted
}