Skip to content

Commit

Permalink
fix: pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiAlexandruParaschiv committed Aug 23, 2024
1 parent 533b858 commit 329f06b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/canonical/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

import { JSDOM } from 'jsdom';
import { composeBaseURL } from '@adobe/spacecat-shared-utils';
import { fetch } from '../support/utils.js';
import { AuditBuilder } from '../common/audit-builder.js';
import { noopUrlResolver } from '../common/audit.js';
Expand Down Expand Up @@ -352,7 +353,7 @@ export function validateCanonicalFormat(canonicalUrl, baseUrl, log) {
}

// Check if the canonical URL has the same domain as the base URL
if (url.hostname !== base.hostname && url.hostname !== `www.${base.hostname}` && `www.${url.hostname}` !== base.hostname) {
if (composeBaseURL(url.hostname) !== composeBaseURL(base.hostname)) {
checks.push({
check: CANONICAL_CHECKS.CANONICAL_URL_SAME_DOMAIN.check,
success: false,
Expand Down

0 comments on commit 329f06b

Please sign in to comment.