From e438136f2a7a7ef2955cd1640b86327576c31825 Mon Sep 17 00:00:00 2001 From: ekremney Date: Mon, 26 Aug 2024 14:09:07 +0200 Subject: [PATCH] feat: coverage --- src/support/utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/support/utils.js b/src/support/utils.js index 16adf195..97c68c9e 100644 --- a/src/support/utils.js +++ b/src/support/utils.js @@ -11,7 +11,7 @@ */ import { context as h2, h1 } from '@adobe/fetch'; -import { hasText, resolveCustomerSecretsName } from '@adobe/spacecat-shared-utils'; +import { hasText, prependSchema, resolveCustomerSecretsName } from '@adobe/spacecat-shared-utils'; import URI from 'urijs'; import { JSDOM } from 'jsdom'; import { GetSecretValueCommand, SecretsManagerClient } from '@aws-sdk/client-secrets-manager'; @@ -26,8 +26,7 @@ export const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1 // weekly pageview threshold to eliminate urls with lack of samples export async function getRUMUrl(url) { - /* c8 ignore next 1 */ - const urlWithScheme = url.startsWith('http') ? url : `https://${url}`; + const urlWithScheme = prependSchema(url); const resp = await fetch(urlWithScheme); const finalUrl = resp.url.split('://')[1]; return finalUrl.endsWith('/') ? finalUrl.slice(0, -1) : /* c8 ignore next */ finalUrl;