From 721b987323077b8ac30b021cdd56506f5fcbf65f Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Fri, 7 Jul 2017 00:31:04 +0100 Subject: [PATCH] Make sure content type header is set before checking it --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a627fef..6ae37e3 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,7 @@ http.createServer((req, res) => { } }); - if (origRes.headers['content-type'] === 'text/html') { + if (origRes.headers['content-type'] && origRes.headers['content-type'].includes('text/html')) { stream = stream.pipe(replaceStream(target, host || req.headers.host)); }