diff --git a/rivetkit-swift/Sources/RivetKitClient/URLUtils.swift b/rivetkit-swift/Sources/RivetKitClient/URLUtils.swift index 4ac9bcb07d..0c4d19c804 100644 --- a/rivetkit-swift/Sources/RivetKitClient/URLUtils.swift +++ b/rivetkit-swift/Sources/RivetKitClient/URLUtils.swift @@ -36,7 +36,9 @@ enum URLUtils { } var components = URLComponents(url: baseUrl, resolvingAgainstBaseURL: false) - components?.path = fullPath + // fullPath is already percent-encoded (see buildActorGatewayUrl); .path would + // re-encode `%` and break actor IDs containing `:` (e.g. Cloudflare Workers). + components?.percentEncodedPath = fullPath components?.percentEncodedQuery = queryParts.isEmpty ? nil : queryParts.joined(separator: "&") components?.fragment = nil