fix(tracker): fix fetch proxy headers check
This commit is contained in:
parent
5ea745c14b
commit
df4cac4bde
3 changed files with 8 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
|||
# 9.0.5
|
||||
|
||||
- same fixes but for fetch proxy
|
||||
|
||||
# 9.0.2 & 9.0.3 & 9.0.4
|
||||
|
||||
- fixes for "setSessionTokenHeader" method
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "9.0.4",
|
||||
"version": "9.0.5",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -147,14 +147,16 @@ export class FetchProxyHandler<T extends typeof fetch> implements ProxyHandler<T
|
|||
if (argsList[1] === undefined && argsList[0] instanceof Request) {
|
||||
return argsList[0].headers.append(name, value)
|
||||
} else {
|
||||
if (!argsList[1]) argsList[1] = {}
|
||||
if (argsList[1].headers === undefined) {
|
||||
argsList[1].headers = {}
|
||||
argsList[1] = { ...argsList[1], headers: {} }
|
||||
}
|
||||
if (argsList[1].headers instanceof Headers) {
|
||||
argsList[1].headers.append(name, value)
|
||||
} else if (Array.isArray(argsList[1].headers)) {
|
||||
argsList[1].headers.push([name, value])
|
||||
} else {
|
||||
// @ts-ignore
|
||||
argsList[1].headers[name] = value
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue