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

fix: defaultCompressibleTypes regex issue #331

Open
2 tasks done
rumoursbehindme opened this issue Nov 28, 2024 · 2 comments
Open
2 tasks done

fix: defaultCompressibleTypes regex issue #331

rumoursbehindme opened this issue Nov 28, 2024 · 2 comments

Comments

@rumoursbehindme
Copy link

rumoursbehindme commented Nov 28, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.28.0

Plugin version

No response

Node.js version

20.16.0

Operating system

Windows

Operating system version (i.e. 20.04, 11.3, 10)

10

Description

If content-type is "[application/force-download]" defaultCompressibleTypes won't allow it.
Then it will goto

const data = mimedb[type.split(';', 1)[0].trim().toLowerCase()]
  if (data === undefined) return false
  return data.compressible === true
}

In this [].split() will throw error.

Link to code that reproduces the bug

No response

Expected Behavior

No response

@rumoursbehindme
Copy link
Author

Sorry My fastify version is : '4.28.0'
And fastify-compress version: '7.0.3'

@mcollina
Copy link
Member

mcollina commented Dec 1, 2024

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

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

2 participants