File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
packages/rrweb/src/plugins/network/record Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,16 @@ const defaultNetworkOptions: NetworkRecordOptions = {
67
67
} ;
68
68
69
69
type Headers = Record < string , string > ;
70
+ type Body =
71
+ | string
72
+ | Document
73
+ | Blob
74
+ | ArrayBufferView
75
+ | ArrayBuffer
76
+ | FormData
77
+ | URLSearchParams
78
+ | ReadableStream < Uint8Array >
79
+ | null ;
70
80
71
81
type NetworkRequest = {
72
82
url : string ;
@@ -76,9 +86,9 @@ type NetworkRequest = {
76
86
startTime : number ;
77
87
endTime : number ;
78
88
requestHeaders ?: Headers ;
79
- requestBody ?: unknown ;
89
+ requestBody ?: Body ;
80
90
responseHeaders ?: Headers ;
81
- responseBody ?: unknown ;
91
+ responseBody ?: Body ;
82
92
} ;
83
93
84
94
export type NetworkData = {
@@ -303,6 +313,7 @@ function initXhrObserver(
303
313
if ( xhr . response === undefined || xhr . response === null ) {
304
314
networkRequest . responseBody = null ;
305
315
} else {
316
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
306
317
networkRequest . responseBody = xhr . response ;
307
318
}
308
319
}
You can’t perform that action at this time.
0 commit comments