Skip to content

Commit

Permalink
chore: handle URL objects for replaceFetchResourceForSegmentSite
Browse files Browse the repository at this point in the history
  • Loading branch information
amirtds committed Nov 14, 2023
1 parent e5071ec commit eab140a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lms/templates/widgets/segment-io.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eab140a

Please sign in to comment.