From 45bf7e292fa34b8de87f398fb543af25500e97f5 Mon Sep 17 00:00:00 2001 From: Tim Brandin Date: Fri, 1 May 2015 14:15:58 +0200 Subject: [PATCH] Look for text/html in the content type on the request to better decide when to inject fast render data. --- lib/server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +};