fix(tracker): fix fetch input check
This commit is contained in:
parent
bee960241a
commit
e420d5e8e4
2 changed files with 8 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@openreplay/tracker",
|
"name": "@openreplay/tracker",
|
||||||
"description": "The OpenReplay tracker main package",
|
"description": "The OpenReplay tracker main package",
|
||||||
"version": "10.0.3",
|
"version": "10.0.4",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"logging",
|
"logging",
|
||||||
"replay"
|
"replay"
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,13 @@ export class FetchProxyHandler<T extends typeof fetch> implements ProxyHandler<T
|
||||||
public apply(target: T, _: typeof window, argsList: [RequestInfo | URL, RequestInit]) {
|
public apply(target: T, _: typeof window, argsList: [RequestInfo | URL, RequestInit]) {
|
||||||
const input = argsList[0]
|
const input = argsList[0]
|
||||||
const init = argsList[1]
|
const init = argsList[1]
|
||||||
// @ts-ignore
|
if (
|
||||||
if (!input?.url && !input) return <ReturnType<T>>target.apply(window, argsList)
|
!input ||
|
||||||
|
// @ts-ignore
|
||||||
|
(typeof input !== 'string' && !input?.url)
|
||||||
|
) {
|
||||||
|
return <ReturnType<T>>target.apply(window, argsList)
|
||||||
|
}
|
||||||
|
|
||||||
const isORUrl =
|
const isORUrl =
|
||||||
input instanceof URL || typeof input === 'string'
|
input instanceof URL || typeof input === 'string'
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue