fix: invalid url when href is empty

This commit is contained in:
Alex Varchuk 2022-07-28 15:39:44 +03:00
parent 2a7046b9d3
commit 33da4428cc

View File

@ -35,7 +35,7 @@ export class OpenAPIParser {
const href = IS_BROWSER ? window.location.href : ''; const href = IS_BROWSER ? window.location.href : '';
if (typeof specUrl === 'string') { if (typeof specUrl === 'string') {
this.specUrl = new URL(specUrl, href).href; this.specUrl = href ? new URL(specUrl, href).href : specUrl;
} }
} }