Alorel / shrink-ray

Node.js compression middleware
MIT License
177 stars 16 forks source link

TypeError: this._implicitHeader is not a function #55

Closed lukasoppermann closed 2 years ago

lukasoppermann commented 4 years ago

Hey, sadly you have the same issue as the express-compress package: https://github.com/expressjs/compression/issues/122 This makes it not work with connect on a normal http2 server. Is there a chance you could change this?

fabiwlf commented 3 years ago

If you still need it for http2, you can just extend the express module:

import express from "express";
express.response._implicitHeader = function () {
    this.writeHead(this.statusCode);
};
var app = express();