Fix: Changes WebSocket protocol to wss:// for https (#17173)

This commit is contained in:
Hugo Häggmark 2019-05-20 15:24:49 +02:00 committed by David
parent bfa7c3d963
commit 458bb3b0e3

View File

@ -16,7 +16,7 @@ import { SeriesData } from '@grafana/ui/src/types/data';
import { EpicDependencies } from 'app/store/configureStore';
const convertToWebSocketUrl = (url: string) => {
const protocol = window.location.protocol === 'https' ? 'wss://' : 'ws://';
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
let backend = `${protocol}${window.location.host}${config.appSubUrl}`;
if (backend.endsWith('/')) {
backend = backend.slice(0, backend.length - 1);