mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
lib/client: fix caps with equal sign in value
CAP=a=b wouldn't parse correctly.
This commit is contained in:
parent
5b53fb6fe9
commit
51883292f9
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue