Skip to content

Commit c1c78c2

Browse files
committed
fix: handle Headers in RedirectHandler
1 parent 2de0f34 commit c1c78c2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/handler/redirect-handler.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,10 @@ function cleanRequestHeaders (headers, removeContent, unknownOrigin) {
227227
}
228228
}
229229
} else if (headers && typeof headers === 'object') {
230-
for (const key of Object.keys(headers)) {
230+
const entries = headers instanceof Headers ? headers.entries() : Object.entries(headers)
231+
for (const [key, value] of entries) {
231232
if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {
232-
ret.push(key, headers[key])
233+
ret.push(key, value)
233234
}
234235
}
235236
} else {

0 commit comments

Comments
 (0)