fix: invalid url when href is empty (#2105)

This commit is contained in:
Alex Varchuk 2022-07-28 16:37:43 +03:00 committed by GitHub
parent 2a7046b9d3
commit e5f0235985
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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