Browse Source

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

master
Sven Slootweg 2 years ago
parent
commit
dec205665b
  1. 4
      operations/development-server.js

4
operations/development-server.js

@ -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