mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
LibWeb/WebSocket: Allow sending binary blob data over a websocket
This commit is contained in:
parent
6095aa3cc5
commit
4ccc52e921
Notes:
github-actions[bot]
2024-09-29 09:47:40 +00:00
Author: https://github.com/tcl3 Commit: https://github.com/LadybirdBrowser/ladybird/commit/4ccc52e921a Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1561
1 changed files with 5 additions and 1 deletions
|
@ -287,7 +287,11 @@ void WebSocket::on_message(ByteBuffer message, bool is_text)
|
|||
|
||||
if (m_binary_type == "blob") {
|
||||
// type indicates that the data is Binary and binaryType is "blob"
|
||||
TODO();
|
||||
HTML::MessageEventInit event_init;
|
||||
event_init.data = FileAPI::Blob::create(realm(), message, "text/plain;charset=utf-8"_string);
|
||||
event_init.origin = url().release_value_but_fixme_should_propagate_errors();
|
||||
dispatch_event(HTML::MessageEvent::create(realm(), HTML::EventNames::message, event_init));
|
||||
return;
|
||||
} else if (m_binary_type == "arraybuffer") {
|
||||
// type indicates that the data is Binary and binaryType is "arraybuffer"
|
||||
HTML::MessageEventInit event_init;
|
||||
|
|
Loading…
Reference in a new issue