Skip to content

Commit

Permalink
fix: update how origin url is gathered to resolve canonical url (#19054)
Browse files Browse the repository at this point in the history
  • Loading branch information
RadhepS authored Jul 19, 2024
1 parent 8d7854e commit 49dab0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion projects/core/src/routing/facade/routing.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ describe('RoutingService', () => {
cxRoute: 'product',
params: { code: '123' },
});
expect(url).toEqual(`${winRef.document.location.origin}/product/123`);
expect(url).toEqual(`${winRef.location.origin}/product/123`);
});
});

Expand Down
5 changes: 1 addition & 4 deletions projects/core/src/routing/facade/routing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ export class RoutingService {
* The absolute url uses the origin of the current location.
*/
getFullUrl(commands: UrlCommands, extras?: NavigationExtras) {
return `${this.winRef.document.location.origin}${this.getUrl(
commands,
extras
)}`;
return `${this.winRef.location.origin}${this.getUrl(commands, extras)}`;
}

/**
Expand Down

0 comments on commit 49dab0d

Please sign in to comment.