@continuedev/fetch 1.0.11 → 1.0.12
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/fetch.js +8 -8
- package/package.json +1 -1
- package/src/fetch.ts +8 -7
package/dist/fetch.js
CHANGED
|
@@ -44,15 +44,15 @@ async function logResponse(resp) {
|
|
|
44
44
|
resp.headers.forEach((value, key) => {
|
|
45
45
|
console.log(` ${key}: ${value}`);
|
|
46
46
|
});
|
|
47
|
+
// TODO: For streamed responses, this caused the response to be consumed and the connection would just hang open
|
|
47
48
|
// Clone response to read body without consuming it
|
|
48
|
-
const respClone = resp.clone();
|
|
49
|
-
try {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
49
|
+
// const respClone = resp.clone();
|
|
50
|
+
// try {
|
|
51
|
+
// const responseText = await respClone.text();
|
|
52
|
+
// console.log(`Response Body: ${responseText}`);
|
|
53
|
+
// } catch (e) {
|
|
54
|
+
// console.log("Could not read response body:", e);
|
|
55
|
+
// }
|
|
56
56
|
console.log("======================");
|
|
57
57
|
}
|
|
58
58
|
function logError(error) {
|
package/package.json
CHANGED
package/src/fetch.ts
CHANGED
|
@@ -60,14 +60,15 @@ async function logResponse(resp: Response) {
|
|
|
60
60
|
console.log(` ${key}: ${value}`);
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
// TODO: For streamed responses, this caused the response to be consumed and the connection would just hang open
|
|
63
64
|
// Clone response to read body without consuming it
|
|
64
|
-
const respClone = resp.clone();
|
|
65
|
-
try {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} catch (e) {
|
|
69
|
-
|
|
70
|
-
}
|
|
65
|
+
// const respClone = resp.clone();
|
|
66
|
+
// try {
|
|
67
|
+
// const responseText = await respClone.text();
|
|
68
|
+
// console.log(`Response Body: ${responseText}`);
|
|
69
|
+
// } catch (e) {
|
|
70
|
+
// console.log("Could not read response body:", e);
|
|
71
|
+
// }
|
|
71
72
|
console.log("======================");
|
|
72
73
|
}
|
|
73
74
|
|