Skip to content

Commit

Permalink
Added safety check for parsing raw headers
Browse files Browse the repository at this point in the history
  • Loading branch information
parthverma1 committed Jul 31, 2024
1 parent e11b4e9 commit 7c26920
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions request.js
Original file line number Diff line number Diff line change
Expand Up @@ -2008,6 +2008,10 @@ Request.prototype.end = function (chunk) {
// Reference to request, so if _reqResInfo is updated (in case of redirects), we still can update the headers
const request = self._reqResInfo.request
Promise.resolve(self.req._header).then(function (header) {
if (!header) {
request.headers = []
return
}
request.headers = parseRequestHeaders(header)
})
}
Expand Down

0 comments on commit 7c26920

Please sign in to comment.