lib/client: fix caps with equal sign in value

CAP=a=b wouldn't parse correctly.
This commit is contained in:
Simon Ser 2021-07-04 22:26:31 +02:00
parent 5b53fb6fe9
commit 51883292f9

View file

@ -354,13 +354,13 @@ export default class Client extends EventTarget {
addAvailableCaps(s) {
let l = s.split(" ");
l.forEach((s) => {
let parts = s.split("=");
let k = parts[0].toLowerCase();
let v = "";
if (parts.length > 1) {
v = parts[1];
let i = s.indexOf("=");
let k = s, v = "";
if (i >= 0) {
k = s.slice(0, i);
v = s.slice(i + 1);
}
this.availableCaps[k] = v;
this.availableCaps[k.toLowerCase()] = v;
});
}