Skip to content

Commit

Permalink
feat(server): handle absolute URLs cleanly
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Reed committed Jun 6, 2017
1 parent 253f23b commit 5a516a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/OnmsServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export class OnmsServer {
if (forFragment === undefined) {
return this.url;
}
if (forFragment.indexOf('/') === 0 || forFragment.indexOf('http') === 0) {
return forFragment;
}
return URI(this.url).segment(forFragment).toString();
}

Expand Down

0 comments on commit 5a516a2

Please sign in to comment.