prepend slash if missing

This commit is contained in:
Erik 2022-11-09 16:19:25 +02:00
parent 0f71c25cdb
commit 9d3fe5f2c2
Signed by: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -7,6 +7,7 @@ class Endpoint {
this.server = server; this.server = server;
if (!path) Util.fatal(new Error('Missing path in endpoint')); if (!path) Util.fatal(new Error('Missing path in endpoint'));
if (!path.startsWith('/')) path = `/${path}`;
this.path = path; this.path = path;
if (name) this.name = name; if (name) this.name = name;