Open FerencDenes opened 1 year ago
When compressing an xml file (probably other formats as well) with all 3 schemes (br, gzip, deflate) a "," is inserted into the text:
<?xml version="1.0" encoding="UTF-8"?>
When switching off the middleware it did not happen.
This is how to repro:
const express = require("express"); const app = express(); const port = 3000; const querystring = require("querystring"); const shrinkRay = require("shrink-ray-current"); app.use(shrinkRay()); app.get("/xml/:size", (req, res) => { let xml = '<?xml version="1.0" encoding="UTF-8"?>'; xml += "<foo>"; for (let i = 0; i < req.params.size; ++i) { xml += `<bar naaa="foo">abc-${i}</bar>`; } xml += `<bar>false</bar>`; xml += "</foo>"; res.header("Content-Type", "application/xml"); res.status(200).send(xml); }); app.listen(port, () => { console.log(`Example app listening on port ${port}`); });
When compressing an xml file (probably other formats as well) with all 3 schemes (br, gzip, deflate) a "," is inserted into the text:
<?xml version="1.0" encoding="UTF-8"?>
When switching off the middleware it did not happen.
This is how to repro: