diff --git a/lib/server.js b/lib/server.js index b970a2d..5893376 100644 --- a/lib/server.js +++ b/lib/server.js @@ -26,7 +26,8 @@ http.OutgoingMessage.prototype.write = function(chunk, encoding) { var condition = this._injectPayload && !this._injected && encoding === undefined && - //.test(chunk); + //.test(chunk) && + /Content-Type: text\/html/.test(this._header); if(condition) { // if cors headers included if may cause some security holes @@ -54,4 +55,4 @@ http.OutgoingMessage.prototype.write = function(chunk, encoding) { } originalWrite.call(this, chunk, encoding); -}; \ No newline at end of file +};