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);