Skip to content

Commit

Permalink
fix issue: #1892
Browse files Browse the repository at this point in the history
  • Loading branch information
timzaak authored Jun 25, 2024
1 parent e741c68 commit ce5e040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/connect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function connect(

if (opts.unixSocket) {
opts.protocol = opts.protocol.replace('+unix', '') as MqttProtocol
} else if (!opts.protocol?.startsWith('ws')) {
} else if (!opts.protocol?.startsWith('ws') && !opts.protocol?.startsWith('wx')) {

Check failure on line 109 in src/lib/connect/index.ts

View workflow job for this annotation

GitHub Actions / build (20.x)

Replace `!opts.protocol?.startsWith('ws')·&&·!opts.protocol?.startsWith('wx')` with `⏎↹↹!opts.protocol?.startsWith('ws')·&&⏎↹↹!opts.protocol?.startsWith('wx')⏎↹`
// consider path only with ws protocol or unix socket
// url.parse could return path (for example when url ends with a `/`)
// that could break the connection. See https://github.com/mqttjs/MQTT.js/pull/1874
Expand Down

0 comments on commit ce5e040

Please sign in to comment.