[英]Leaving node-fetch response without reading stream
服務中包含以下代碼(在快速終結點上說):
async function (res, req, next) {
const fetch = require('node-fetch');
await fetch('http://example.com/resource', { method: 'DELETE' });
res.status(204).send();
}
由node-fetch
打開的流和連接會發生什么? 它在某個時候關閉嗎? 還是永遠開放?
最好做(await fetch(...args)).text()
以消耗流或完全相同嗎?
連接本身是關閉的,流只是響應。
如果刪除時沒有任何錯誤,則應閱讀流以驗證
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.