[Pkg-javascript-commits] [node-stream-http] 187/208: fix getHeader when header isn't available

Bastien Roucariès rouca at moszumanska.debian.org
Sun Aug 13 13:39:43 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-stream-http.

commit 7c2e61fac0f10fa41bb99bb844be7c93963aada7
Author: Gus Caplan <me at gus.host>
Date:   Wed Apr 26 02:05:49 2017 -0500

    fix getHeader when header isn't available
---
 lib/request.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/request.js b/lib/request.js
index 80149ae..36ad12d 100644
--- a/lib/request.js
+++ b/lib/request.js
@@ -81,8 +81,10 @@ ClientRequest.prototype.setHeader = function (name, value) {
 }
 
 ClientRequest.prototype.getHeader = function (name) {
-	var self = this
-	return self._headers[name.toLowerCase()].value
+	var header = this._headers[name.toLowerCase()]
+	if (header)
+		return header.value
+	return null
 }
 
 ClientRequest.prototype.removeHeader = function (name) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-http.git



More information about the Pkg-javascript-commits mailing list