Skip to content

Commit

Permalink
fix: wrong base url format causing error when constructing new URL
Browse files Browse the repository at this point in the history
  • Loading branch information
tatomyr committed May 11, 2022
1 parent 1f417d6 commit 331eaf8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/services/OpenAPIParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class OpenAPIParser {
this.spec = spec;
this.allowMergeRefs = spec.openapi.startsWith('3.1');

const href = IS_BROWSER ? window.location.href : '';
const href = IS_BROWSER ? window.location.href : undefined;
if (typeof specUrl === 'string') {
this.specUrl = new URL(specUrl, href).href;
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/models/Example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class ExampleModel {
this.summary = example.summary;
this.description = example.description;
if (example.externalValue) {
this.externalValueUrl = new URL(example.externalValue, parser.specUrl || '').href;
this.externalValueUrl = new URL(example.externalValue, parser.specUrl).href;
}
parser.exitRef(infoOrRef);

Expand Down

0 comments on commit 331eaf8

Please sign in to comment.