Skip to content

Commit

Permalink
Merge branch 'main' into improve-electron-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Aug 30, 2024
2 parents 196de0b + 5c8bdf9 commit 47f74a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@


## [5.10.1](https://github.com/mqttjs/MQTT.js/compare/v5.10.0...v5.10.1) (2024-08-28)


### Bug Fixes

* **browser:** handle `Blob` payloads ([#1930](https://github.com/mqttjs/MQTT.js/issues/1930)) ([86b7959](https://github.com/mqttjs/MQTT.js/commit/86b795983d86847e1da334fd0d30cbd80f92b540))

# [5.10.0](https://github.com/mqttjs/MQTT.js/compare/v5.9.1...v5.10.0) (2024-08-14)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mqtt",
"description": "A library for the MQTT protocol",
"version": "5.10.0",
"version": "5.10.1",
"contributors": [
"Adam Rudd <adamvrr@gmail.com>",
"Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
Expand Down
4 changes: 3 additions & 1 deletion src/lib/connect/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ const browserStreamBuilder: StreamBuilder = (client, opts) => {
/**
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/message_event
*/
function onMessage(event: MessageEvent) {
async function onMessage(event: MessageEvent) {
let { data } = event
if (data instanceof ArrayBuffer) data = Buffer.from(data)
else if (data instanceof Blob)
data = Buffer.from(await new Response(data).arrayBuffer())
else data = Buffer.from(data as string, 'utf8')
if (proxy && !proxy.destroyed) {
proxy.push(data)
Expand Down

0 comments on commit 47f74a9

Please sign in to comment.