Browse Source

Hotfix for #416 (#429)

- check for empty grafanauUrl
pull/1/head
rozetko 6 years ago
parent
commit
8ddcb8ac77
  1. 3
      server/src/utils/url.ts

3
server/src/utils/url.ts

@ -1,6 +1,9 @@
import * as url from 'url-parse'; import * as url from 'url-parse';
export function normalizeUrl(grafanaUrl: string) { export function normalizeUrl(grafanaUrl: string) {
if(!grafanaUrl) {
return grafanaUrl;
}
let urlObj = new url(grafanaUrl); let urlObj = new url(grafanaUrl);
if(urlObj.protocol !== 'http:' && urlObj.protocol !== 'https:') { if(urlObj.protocol !== 'http:' && urlObj.protocol !== 'https:') {
grafanaUrl = `http://${grafanaUrl}`; grafanaUrl = `http://${grafanaUrl}`;

Loading…
Cancel
Save