fix(join): use origin + pathname instead of plain location

This commit is contained in:
Travis Shivers 2020-09-04 20:54:44 -05:00
parent 2171b0c6cd
commit d9a37f2cf0
No known key found for this signature in database
GPG Key ID: EE4CC2891B8FCD33
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ export default {
ESTABLISH_SOCKET_CONNECTION: async ({ getters, commit, dispatch }) => {
await dispatch('DISCONNECT_IF_CONNECTED');
const properBase = new URL(getters.GET_SERVER, window.location);
const currentUrl = new URL(window.location.pathname, window.location.origin);
const properBase = new URL(getters.GET_SERVER, currentUrl);
const url = combineUrl('socket.io', properBase.toString());
console.log('ESTABLISH_SOCKET_CONNECTION', url.toString());