hap-node-client
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -46,3 +46,3 @@ // Monkey patch before you require http for the first time. | ||
// debug("res", data.toString()); | ||
if (response.headers['Transfer-Encoding'] && response.headers['Transfer-Encoding'].toLowerCase() === 'chunked' && data.slice(-7).toString() !== '\r\n0\r\n\r\n') { | ||
if (response.headers && response.headers['Transfer-Encoding'] && response.headers['Transfer-Encoding'].toLowerCase() === 'chunked' && data.slice(-7).toString() !== '\r\n0\r\n\r\n') { | ||
this.chunked = true; | ||
@@ -49,0 +49,0 @@ buffer.push(data); |
@@ -129,3 +129,3 @@ // Borrowed and heaviliy modifed from https://github.com/miguelmota/http-message-parser | ||
if (body && body.length) { | ||
if (result.headers['Content-Type'] === 'application/hap+json' || result.headers['Content-Type'] === 'application/json') { | ||
if ((result.headers && result.headers['Content-Type'] === 'application/hap+json') || (result.headers && result.headers['Content-Type'] === 'application/json')) { | ||
// JSON.parse JSON message's | ||
@@ -132,0 +132,0 @@ try { |
{ | ||
"name": "hap-node-client", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Client for Hap-NodeJS", | ||
@@ -5,0 +5,0 @@ "main": "HAPNodeJSClient.js", |
25435