Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comma is inserted into the encoded text #64

Open
FerencDenes opened this issue Jan 6, 2023 · 0 comments
Open

Comma is inserted into the encoded text #64

FerencDenes opened this issue Jan 6, 2023 · 0 comments

Comments

@FerencDenes
Copy link

When compressing an xml file (probably other formats as well) with all 3 schemes (br, gzip, deflate) a "," is inserted into the text:

abc-0 abc-1 abc-2 abc-3 ... abc-564 abc-565 abc-566 **abc-567** abc-568 abc-569 false

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}`);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant