File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
aws-predictions/src/main/java/com/amplifyframework/predictions/aws/service Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ internal class RunFaceLivenessSession(
4747 onError : Consumer <PredictionsException >
4848) {
4949
50- private val livenessEndpoint = " wss://streaming-rekognition. ${ sessionInformation.region} .amazonaws.com:443 "
50+ private val livenessEndpoint = getStreamingEndpointForRegion( sessionInformation.region)
5151
5252 private val livenessWebSocket = LivenessWebSocket (
5353 credentialsProvider = credentialsProvider,
@@ -183,4 +183,17 @@ internal class RunFaceLivenessSession(
183183 livenessWebSocket.clientStoppedSession = true
184184 reasonCode?.let { livenessWebSocket.destroy(it) } ? : livenessWebSocket.destroy()
185185 }
186+
187+ private fun getStreamingEndpointForRegion (region : String ): String {
188+ val baseDomain = when {
189+ region.startsWith(" us-isof" , ignoreCase = true ) -> ISO_PARTITION_BASE_DOMAIN
190+ else -> DEFAULT_BASE_DOMAIN
191+ }
192+ return " wss://streaming-rekognition.$region .$baseDomain :443"
193+ }
194+
195+ companion object {
196+ private const val ISO_PARTITION_BASE_DOMAIN = " csp.hci.ic.gov"
197+ private const val DEFAULT_BASE_DOMAIN = " amazonaws.com"
198+ }
186199}
You can’t perform that action at this time.
0 commit comments