Skip to content

[fix] Not Support identity;q=1, *;q=0 #232

@743v45

Description

@743v45

Describe the bug

Node.js version: v22.11.0

OS version: MacOS 15.3.1

koa-compress version: 5.1.1

Description: Accept-Encoding: identity;q=1, *;q=0 not work

Actual behavior

response with Content-Encoding: gzip

Expected behavior

Content-Encoding: identity

Code to reproduce

const Koa = require('koa');
const compress = require('koa-compress');

const app = new Koa();

app.use(compress(
  {
    filter: (contentType) => {
      return true;
    },
    threshold: 1,
    br: false,
  },
));

app.use(async (ctx) => {
    ctx.body = 'This is a sample response that will be compressed if the client supports it.';
});

const port = 3000;
app.listen(port, () => {
    console.log(`Server is running on port ${port}`);
});

Image

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions