MeowWolf / node-red-contrib-amqp

AMQP nodes for node-red
22 stars 18 forks source link

Encode username and password in percent-encoding format #36

Closed pauldeng closed 3 years ago

pauldeng commented 3 years ago

The Issue If the username or password contains any special character, the connection to RabbitMQ server would fail.

According to the amqplib document, usernames and passwords should be percent-encoded.

The Workaround You can use existing online tool such as urlencoder to manually convert username or password to percent-encoded format while setting the connection parameters.

The PR This PR uses escape() method to encode username and password into amqplib expected format.

amodelbello commented 3 years ago

@pauldeng - Good find and thanks a lot for the contribution!

I changed querystring.escape() to encodeURIComponent() because the former is legacy and should be avoided.