fastify-compress icon indicating copy to clipboard operation
fastify-compress copied to clipboard

fix: defaultCompressibleTypes regex issue

Open rumoursbehindme opened this issue 1 year ago • 2 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] 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 avatar Nov 28 '24 11:11 rumoursbehindme

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

rumoursbehindme avatar Nov 28 '24 11:11 rumoursbehindme

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

mcollina avatar Dec 01 '24 08:12 mcollina