@kush_hemant/react-api-monitor 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +0 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,7 +37,6 @@ var isPatched = false;
|
|
|
37
37
|
function monitorFetch() {
|
|
38
38
|
if (isPatched) return;
|
|
39
39
|
isPatched = true;
|
|
40
|
-
if (!window.fetch) return;
|
|
41
40
|
const originalFetch = window.fetch;
|
|
42
41
|
window.fetch = async function(...args) {
|
|
43
42
|
const input = args[0];
|
|
@@ -64,9 +63,6 @@ function monitorFetch() {
|
|
|
64
63
|
try {
|
|
65
64
|
if (init.body) {
|
|
66
65
|
requestBody = typeof init.body === "string" ? init.body : JSON.stringify(init.body);
|
|
67
|
-
} else if (input instanceof Request) {
|
|
68
|
-
const clone = input.clone();
|
|
69
|
-
requestBody = await clone.text();
|
|
70
66
|
}
|
|
71
67
|
} catch {
|
|
72
68
|
}
|
|
@@ -87,15 +83,6 @@ function monitorFetch() {
|
|
|
87
83
|
{ once: true }
|
|
88
84
|
);
|
|
89
85
|
}
|
|
90
|
-
sendLog({
|
|
91
|
-
type: "api_start",
|
|
92
|
-
transport: "fetch",
|
|
93
|
-
url,
|
|
94
|
-
method,
|
|
95
|
-
requestHeaders,
|
|
96
|
-
requestBody,
|
|
97
|
-
...getMetadata()
|
|
98
|
-
});
|
|
99
86
|
try {
|
|
100
87
|
const response = await originalFetch.apply(
|
|
101
88
|
this,
|