Skip to content

Commit

Permalink
fix(wechat): do not ignore path with wx protocol (#1894)
Browse files Browse the repository at this point in the history
* fix issue: #1892

* lint-fix

---------

Co-authored-by: y-crew server <server@amiro.com>
  • Loading branch information
timzaak and y-crew server authored Jun 26, 2024
1 parent e741c68 commit 300c0b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/connect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ 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')
) {
// 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 300c0b4

Please sign in to comment.