From eab140aa57ea8f1dc1fa43b4029c3582b3d5bc63 Mon Sep 17 00:00:00 2001 From: Amir Tadrisi Date: Tue, 14 Nov 2023 16:50:42 -0500 Subject: [PATCH] chore: handle URL objects for replaceFetchResourceForSegmentSite --- lms/templates/widgets/segment-io.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lms/templates/widgets/segment-io.html b/lms/templates/widgets/segment-io.html index ed3f549bfb7..49a9394acb4 100644 --- a/lms/templates/widgets/segment-io.html +++ b/lms/templates/widgets/segment-io.html @@ -37,6 +37,9 @@ keepalive: resource.keepalive, signal: resource.signal }); + } else if (resource instanceof URL) { + // If resource is a URL object, convert it to a string and replace the URL + return replaceUrl(resource.href); } else { // If it's neither a string nor a Request object, log a warning or handle as needed console.warn('replaceFetchResourceForSegmentSite was called with an unexpected argument type:', typeof resource, resource);