Convert caps to lower case

This commit is contained in:
Simon Ser 2021-01-22 12:27:32 +01:00
parent df2b46175a
commit 06eb639ee9

View file

@ -177,7 +177,7 @@ export default class Client extends EventTarget {
var l = s.split(" ");
l.forEach((s) => {
var parts = s.split("=");
var k = parts[0];
var k = parts[0].toLowerCase();
var v = "";
if (parts.length > 1) {
v = parts[1];
@ -239,6 +239,7 @@ export default class Client extends EventTarget {
break;
case "DEL":
args[0].split(" ").forEach((cap) => {
cap = cap.toLowerCase();
delete this.availableCaps[cap];
delete this.enabledCaps[cap];
});
@ -247,6 +248,7 @@ export default class Client extends EventTarget {
case "ACK":
console.log("Server ack'ed caps:", args[0]);
args[0].split(" ").forEach((cap) => {
cap = cap.toLowerCase();
this.enabledCaps[cap] = true;
if (cap == "sasl" && this.params.saslPlain) {