From 5a516a259b0ab2cac0cc1ab45690d5a9a2ddc944 Mon Sep 17 00:00:00 2001 From: Benjamin Reed Date: Tue, 6 Jun 2017 09:34:36 -0400 Subject: [PATCH] feat(server): handle absolute URLs cleanly --- src/api/OnmsServer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/api/OnmsServer.ts b/src/api/OnmsServer.ts index 23e8f5093..260bdde9d 100644 --- a/src/api/OnmsServer.ts +++ b/src/api/OnmsServer.ts @@ -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(); }