prevent charAt call on websocket listener

pull/2610/head
Hiroyasu Nishiyama 2020-06-11 23:00:56 +09:00
parent 81a4f42673
commit 7694349078
1 changed files with 6 additions and 4 deletions

View File

@ -148,10 +148,12 @@
if (root.slice(-1) != "/") { if (root.slice(-1) != "/") {
root = root+"/"; root = root+"/";
} }
if (this.path.charAt(0) == "/") { if (this.path) {
root += this.path.slice(1); if (this.path.charAt(0) == "/") {
} else { root += this.path.slice(1);
root += this.path; } else {
root += this.path;
}
} }
return root; return root;
}, },