From 4132012ba5d133f26475f670b20f37bd70f10d94 Mon Sep 17 00:00:00 2001 From: Bob Nugmanov Date: Mon, 29 Jun 2015 23:01:54 -0700 Subject: [PATCH 1/2] don't crash on missing content type header --- http_trace | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"))); From d54fb7635e5b7039ba60a2f1727b14ccf3e9b143 Mon Sep 17 00:00:00 2001 From: Bob Nugmanov Date: Mon, 29 Jun 2015 23:07:37 -0700 Subject: [PATCH 2/2] 0.5.1 --- package.json | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) 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" + } }