@magic-xpa/engine 4.1200.0-dev4120.118 → 4.1200.0-dev4120.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5939,12 +5939,18 @@ class HttpManager {
5939
5939
  /// <returns>if the response contains the error indicator - the error indicator is truncated and the remaining is returned.
5940
5940
  /// otherwise - null (indicating that the 'http Response' didn't contain an error).</returns>
5941
5941
  static CheckAndGetErrorResponse(httpResponse) {
5942
+ const errorResponseIndicator = Encoding.UTF8.GetBytes(ConstInterface.V24_RIA_ERROR_PREFIX);
5942
5943
  let errorResponse = null;
5943
- const buffer = Encoding.UTF8.GetString(new Uint8Array(httpResponse), 0, httpResponse.byteLength);
5944
- if (buffer.startsWith(ConstInterface.V24_RIA_ERROR_PREFIX)) {
5945
- const errorResponseStr = buffer.substr(ConstInterface.V24_RIA_ERROR_PREFIX.length);
5946
- const errorResponseBytes = Encoding.UTF8.GetBytes(errorResponseStr);
5947
- errorResponse = errorResponseBytes.buffer;
5944
+ const httpResponseBytes = new Uint8Array(httpResponse);
5945
+ // Find 'errorResponseIndicator' in 'httpResponse', starting from the start index
5946
+ let i;
5947
+ for (i = 0; i < errorResponseIndicator.length; i++) {
5948
+ if (httpResponseBytes[i] !== errorResponseIndicator[i]) {
5949
+ break;
5950
+ }
5951
+ }
5952
+ if (i === errorResponseIndicator.length) {
5953
+ errorResponse = httpResponse.slice(errorResponseIndicator.length);
5948
5954
  }
5949
5955
  return errorResponse;
5950
5956
  }
@@ -39492,7 +39498,7 @@ class CommandsTable {
39492
39498
  }
39493
39499
  }
39494
39500
 
39495
- let CurrentClientVersion = '4.1200.0-dev4120.118';
39501
+ let CurrentClientVersion = '4.1200.0-dev4120.119';
39496
39502
 
39497
39503
  // @dynamic
39498
39504
  class ClientManager {