diff --git a/http_trace b/http_trace index 3842dc7..1775fb9 100755 --- a/http_trace +++ b/http_trace @@ -389,7 +389,8 @@ function on_tcp_session(tcp_session) { // TODO - need real binary_body check, more than just content-type if (options.bodies && !session.request.binary_body) { - if (session.request.headers["content-type"].match(/json/)) { + if (session.request.headers["content-type"] && + session.request.headers["content-type"].match(/json/)) { console.log(ANSI.green(data.toString("utf8"))); } else { console.log(format_json(data.toString("utf8"))); diff --git a/package.json b/package.json index d140016..52412ed 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,17 @@ -{ "name" : "http_trace", - "version" : "0.5.0", - "description" : "Live HTTP packet capture and protocol decoding", - "author": "Matt Ranney ", - "main": "./http_trace", - "repository": { - "type": "git", - "url": "git://github.com/mranney/http_trace.git" - }, - "dependencies": { - "pcap": ">=2.0.0" - }, - "bin": { - "http_trace": "./http_trace" - } +{ + "name": "http_trace", + "version": "0.5.1", + "description": "Live HTTP packet capture and protocol decoding", + "author": "Matt Ranney ", + "main": "./http_trace", + "repository": { + "type": "git", + "url": "git://github.com/mranney/http_trace.git" + }, + "dependencies": { + "pcap": ">=2.0.0" + }, + "bin": { + "http_trace": "./http_trace" + } }