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

master
Sven Slootweg před 4 roky
rodič 9f1d2cf276
revize 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) {

Načítá se…
Zrušit
Uložit