Comparing version 0.4.3 to 0.4.4
@@ -42,3 +42,3 @@ const zlib = require('zlib') | ||
var cb = getCallback(arguments) | ||
if (closed) return cb && cb() | ||
if (isEnded()) return cb && cb() | ||
@@ -83,3 +83,3 @@ if (data) { | ||
function isEnded() { | ||
return closed || res.headersSent | ||
return closed || buf === null | ||
} | ||
@@ -113,4 +113,8 @@ | ||
// Write the response head and body | ||
if (headArgs) res.writeHead.apply(res, headArgs) | ||
// Write the response head | ||
if (headArgs && !res.headersSent) { | ||
res.writeHead.apply(res, headArgs) | ||
} | ||
// Write body | ||
res.write(finalBody, finalEncoding) | ||
@@ -124,3 +128,3 @@ | ||
// Finally, send EOF | ||
// Send EOF | ||
res.end(cb) | ||
@@ -127,0 +131,0 @@ } |
{ | ||
"name": "rocky", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Full-featured, middleware-oriented HTTP and WebSocket proxy supporting traffic replay and intercept", | ||
@@ -5,0 +5,0 @@ "repository": "h2non/rocky", |
@@ -79,2 +79,3 @@ # rocky [![Build Status](https://api.travis-ci.org/h2non/rocky.svg?branch=master&style=flat)](https://travis-ci.org/h2non/rocky) [![Code Climate](https://codeclimate.com/github/h2non/rocky/badges/gpa.svg)](https://codeclimate.com/github/h2non/rocky) [![NPM](https://img.shields.io/npm/v/rocky.svg)](https://www.npmjs.org/package/rocky) | ||
- As HTTP proxy for performance testing | ||
- As traditional forward HTTP proxy (e.g: Squid) | ||
- For HTTP session manipulation and debugging | ||
@@ -81,0 +82,0 @@ - For HTTP traffic recording and inspection |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172358
4284
1014