Merge pull request #5092 from GabrielInTheWorld/fixDecoding
Fixes decoding caused by exceeding stack size
This commit is contained in:
commit
cc2dc1eeff
@ -545,8 +545,10 @@ export class WebsocketService {
|
|||||||
* @param buffer - Buffer to convert
|
* @param buffer - Buffer to convert
|
||||||
* @returns String
|
* @returns String
|
||||||
*/
|
*/
|
||||||
private arrayBufferToString(buffer: ArrayBuffer): string {
|
private arrayBufferToString(buffer: Uint8Array): string {
|
||||||
return String.fromCharCode.apply(null, Array.from(new Uint16Array(buffer)));
|
return Array.from(buffer)
|
||||||
|
.map(code => String.fromCharCode(code))
|
||||||
|
.join('');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user