in OSSSwiftDemo/OSSSwiftDemoTests/OSSCnameTests.swift [65:84]
func testAPI_customExcludeCname() {
let conf = OSSClientConfiguration.init()
conf.cnameExcludeList = ["osstest.xxyycc.com", "vpc.sample.com"]
let provider = OSSAuthCredentialProvider(authServerUrl: OSS_STSTOKEN_URL)
client = OSSClient.init(endpoint: OSS_CNAME_URL,
credentialProvider: provider,
clientConfiguration: conf)
let request = OSSGetObjectRequest()
request.bucketName = OSS_BUCKET_PRIVATE
request.objectKey = fileNames[0]
request.downloadProgress = { (bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) -> Void in
OSSLogVerbose("bytesWritten: \(bytesWritten), totalBytesWritten: \(totalBytesWritten), totalBytesExpectedToWrite: \(totalBytesExpectedToWrite)")
}
let task = client.getObject(request)
task.continue({ (t) -> Any? in
XCTAssertNil(t.error)
return nil
}).waitUntilFinished()
}