0

I have a simple node route for an image. I set the Content-Encoding to gzip

and i get this error in browser

http://localhost:4000/image net::ERR_CONTENT_DECODING_FAILED 200 (OK)

app.get("/image", (req, res) => {
  res.set("Cache-Control", "public, max-age=120, immutable");
  res.set("Content-Encoding", "gzip");
  res.sendFile(path.join(__dirname, "image.jpg"));
});
George Paouris
  • 525
  • 4
  • 16

0 Answers0