Browse Source

Strip fragments from URL when connecting to websocket

pull/2617/head
Gabe Kangas 3 years ago
parent
commit
b0f88519d0
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 8
      web/components/stores/ClientConfigStore.tsx

8
web/components/stores/ClientConfigStore.tsx

@ -321,7 +321,13 @@ export const ClientConfigStore: FC = () => { @@ -321,7 +321,13 @@ export const ClientConfigStore: FC = () => {
const startChat = async () => {
try {
const { socketHostOverride } = clientConfig;
const host = socketHostOverride || window.location.toString();
// Get a copy of the browser location without #fragments.
const l = window.location;
l.hash = '';
const location = l.toString().replaceAll('#', '');
const host = socketHostOverride || location;
ws = new WebsocketService(accessToken, '/ws', host);
ws.handleMessage = handleMessage;
setWebsocketService(ws);

Loading…
Cancel
Save