Don't break when no content-type is set on a response

master
Sven Slootweg 4 years ago
parent 9f1d2cf276
commit dec205665b

@ -18,7 +18,9 @@ function monkeyPatchEnd(res) {
let prefix;
if (originalChunk == null || typeof originalChunk === "string" || Buffer.isBuffer(originalChunk)) {
if (res.getHeader("content-type").startsWith("text/html")) {
let typeHeader = res.getHeader("content-type");
if (typeHeader != null && typeHeader.startsWith("text/html")) {
let contentLength = res.getHeader("content-length");
if (contentLength != null) {

Loading…
Cancel
Save