fix(tracker): fix fetch input check

This commit is contained in:
nick-delirium 2023-12-20 16:45:11 +01:00
parent 8580020f2c
commit 9a84d1d8b6
2 changed files with 8 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker",
"description": "The OpenReplay tracker main package",
"version": "11.0.1",
"version": "11.0.2",
"keywords": [
"logging",
"replay"

View file

@ -131,8 +131,13 @@ export class FetchProxyHandler<T extends typeof fetch> implements ProxyHandler<T
public apply(target: T, _: typeof window, argsList: [RequestInfo | URL, RequestInit]) {
const input = argsList[0]
const init = argsList[1]
// @ts-ignore
if (!input || !input?.url) return <ReturnType<T>>target.apply(window, argsList)
if (
!input ||
// @ts-ignore
(typeof input !== 'string' && !input?.url)
) {
return <ReturnType<T>>target.apply(window, argsList)
}
const isORUrl =
input instanceof URL || typeof input === 'string'