fix tracker: 12.0.12 with some fixes for network proxy
This commit is contained in:
parent
3e0ced0237
commit
5c0974fbba
5 changed files with 16 additions and 4 deletions
|
|
@ -1,6 +1,11 @@
|
|||
# 12.0.12
|
||||
|
||||
- fix for potential redux plugin issues after .11 ...
|
||||
|
||||
# 12.0.11
|
||||
|
||||
- better restart on unauth (new token assign for long sessions)
|
||||
- more safeguards around arraybuffer and dataview types for network proxy
|
||||
|
||||
# 12.0.10
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@openreplay/tracker",
|
||||
"description": "The OpenReplay tracker main package",
|
||||
"version": "12.0.10-beta.1",
|
||||
"version": "12.0.12",
|
||||
"keywords": [
|
||||
"logging",
|
||||
"replay"
|
||||
|
|
|
|||
|
|
@ -153,13 +153,13 @@ export const genFormattedBody = (body?: BodyInit) => {
|
|||
result[key] = typeof value === 'string' ? value : '[object Object]'
|
||||
}
|
||||
} else if (
|
||||
ArrayBuffer.isView(body) ||
|
||||
body instanceof Blob ||
|
||||
body instanceof ReadableStream ||
|
||||
body instanceof ArrayBuffer
|
||||
) {
|
||||
result = 'byte data'
|
||||
result = '[byte data]'
|
||||
} else if (isPureObject(body)) {
|
||||
// overriding ArrayBufferView which is not convertable to string
|
||||
result = <any>body
|
||||
} else {
|
||||
result = `can't parse body ${typeof body}`
|
||||
|
|
@ -175,6 +175,9 @@ export function isIterable(value: any) {
|
|||
if (value === null || value === undefined) {
|
||||
return false
|
||||
}
|
||||
if (ArrayBuffer.isView(value)) {
|
||||
return false
|
||||
}
|
||||
return typeof Symbol !== 'undefined' && typeof value[Symbol.iterator] === 'function'
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,14 @@ describe('Network utility function tests', () => {
|
|||
it('genFormattedBody should format body correctly', () => {
|
||||
const param = new URLSearchParams('key=value&other=test')
|
||||
const blob = new Blob([param.toString()], { type: 'text/plain' })
|
||||
const uArr = new Uint8Array([1, 2, 3])
|
||||
const dataView = new DataView(uArr.buffer)
|
||||
expect(genFormattedBody('{"key":"value"}')).toEqual({ key: 'value' })
|
||||
expect(genFormattedBody('key=value&other=test')).toEqual({ key: 'value', other: 'test' })
|
||||
expect(genFormattedBody(param)).toEqual({ key: 'value', other: 'test' })
|
||||
expect(genFormattedBody(blob)).toEqual('byte data')
|
||||
expect(genFormattedBody(blob)).toEqual('[byte data]')
|
||||
expect(genFormattedBody(dataView)).toEqual('[byte data]')
|
||||
expect(genFormattedBody(uArr)).toEqual('[byte data]')
|
||||
})
|
||||
|
||||
it('isPureObject should return true for objects', () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue