Browse Source

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

master
Sven Slootweg 3 months ago
parent
commit
dec205665b
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      operations/development-server.js

+ 3
- 1
operations/development-server.js View File

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