You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below file opens a WebSocket on a site (wss://echo.websocket.org) which simply echoes what is send, and sends a text as ArrayBuffer.
When using version 3.2.1, the response is a blob containing the sent text, which is the expected behavior.
When using version 3.2.2 , the response is a text which is the sent text encoded in base64, which is wrong.
Below the steps to reproduce the issue.
Create an HTML file with below content;
open this file in a web browser;
open the JS console (the browser one or the eruda one);
you should see, as expected:
Blob (correct): This is the text used for testing!
Now:
change in the file at line 5 3.2.1 to 3.2.2 (switching to the latest version);
reload the file in the web browser;
reopen, if needed, the JS console;
you will see:
Text (wrong): VGhpcyBpcyB0aGUgdGV4dCB1c2VkIGZvciB0ZXN0aW5nIQ==
Base64 decoded above text: This is the text used for testing!
Maybe the problem only affects ArrayBuffer or only WebSocket, but I couldn't reproduce the problem without involving both (I very rarely use JS)...
The bug_eruda.html file (HTML files can not be joined to issues ):
<!DOCTYPE html><html><head><!-- Version 3.2.1 works, version 3.2.2 fails! --><scriptsrc="https://cdn.jsdelivr.net/npm/eruda@3.2.1/eruda.min.js"></script><script>functiontest(){consttext="This is the text used for testing!"constenc=newTextEncoder();constws=newWebSocket("wss://echo.websocket.org");functionlogBlob(blob){constreader=newFileReader()functiononLoadEnd(e){reader.removeEventListener('loadend',onLoadEnd,false)console.log("Blob (correct): ",reader.result);}reader.addEventListener('loadend',onLoadEnd,false)reader.readAsText(blob)}ws.onmessage=function(event){if(event.data.type==="")logBlob(event.data);elseif(!event.data.startsWith("Request")){// To skip the first response of 'echo.websocket.org'.console.log("Text (wrong): ",event.data);console.log("Base64 decoded above text: ",atob(event.data));}}ws.onopen=function(){ws.send(enc.encode(text));};}</script></head><bodyonload="eruda.init();test();"></body></html>
The text was updated successfully, but these errors were encountered:
Hello,
The below file opens a WebSocket on a site (wss://echo.websocket.org) which simply echoes what is send, and sends a text as ArrayBuffer.
When using version 3.2.1, the response is a blob containing the sent text, which is the expected behavior.
When using version 3.2.2 , the response is a text which is the sent text encoded in base64, which is wrong.
Below the steps to reproduce the issue.
Now:
3.2.1
to3.2.2
(switching to the latest version);Maybe the problem only affects ArrayBuffer or only WebSocket, but I couldn't reproduce the problem without involving both (I very rarely use JS)...
The bug_eruda.html file (HTML files can not be joined to issues ):
The text was updated successfully, but these errors were encountered: