Skip to content

Commit

Permalink
fix: now host detection is in sync with server part of the ILC (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleT authored Jun 1, 2021
1 parent 13c193c commit 9be0783
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ilc/client/GuardManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ export default class GuardManager {
route: {
meta: route.meta,
url: route.reqUrl,
hostname: window.location.hostname,
hostname: window.location.host,
},
prevRoute: {
meta: prevRoute.meta,
url: prevRoute.reqUrl,
hostname: window.location.hostname,
hostname: window.location.host,
},
navigate: this.#router.navigateToUrl,
});
Expand Down
16 changes: 8 additions & 8 deletions ilc/client/GuardManager.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ describe('GuardManager', () => {

for (const hook of hooks) {
sinon.assert.calledOnceWithExactly(hook, {
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.hostname},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.hostname},
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.host},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.host},
navigate: router.navigateToUrl
});
}
Expand Down Expand Up @@ -129,8 +129,8 @@ describe('GuardManager', () => {

for (const hook of [hooks[0], hooks[1]]) {
sinon.assert.calledOnceWithExactly(hook, {
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.hostname},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.hostname},
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.host},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.host},
navigate: router.navigateToUrl
});
}
Expand Down Expand Up @@ -159,8 +159,8 @@ describe('GuardManager', () => {

for (const hook of [hooks[0], hooks[1]]) {
sinon.assert.calledOnceWithExactly(hook, {
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.hostname},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.hostname},
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.host},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.host},
navigate: router.navigateToUrl
});
}
Expand Down Expand Up @@ -189,8 +189,8 @@ describe('GuardManager', () => {

for (const hook of [hooks[0], hooks[1]]) {
sinon.assert.calledOnceWithExactly(hook, {
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.hostname},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.hostname},
route: {meta: route.meta, url: route.reqUrl, hostname: window.location.host},
prevRoute: {meta: prevRoute.meta, url: prevRoute.reqUrl, hostname: window.location.host},
navigate: router.navigateToUrl
});
}
Expand Down

0 comments on commit 9be0783

Please sign in to comment.