From 8287f6fc3f5f106eec4825c778f5891a7e2c2c50 Mon Sep 17 00:00:00 2001 From: Shun Zi <20991618+shunf4@users.noreply.github.com> Date: Fri, 28 Jun 2024 23:47:44 +0800 Subject: [PATCH] fix: Remove opts.headers in normalizeOptions, preventing it being used in subsequent unrelated requests --- lib/options.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/options.js b/lib/options.js index 0bf53f7..a6ae490 100644 --- a/lib/options.js +++ b/lib/options.js @@ -37,6 +37,10 @@ const normalizeOptions = (opts) => { // remove timeout since we already used it to set our own idle timeout delete normalized.timeout + // since opts is often passed when initiating requests, it may contain + // headers, which should not be saved in an agent + delete normalized.headers + return normalized }