Skip to content

cleanRequestFiles doesn't clean file when file size is reached #470

Open
@ThallesP

Description

@ThallesP

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.21.0

Plugin version

7.7.3

Node.js version

18.16.0

Operating system

Linux

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

Ubuntu 22.04.2 LTS (wsl2)

Description

When calling cleanRequestFiles after the error "request file too large" happens, it doesn't clean the temp file, as i suggestion this file should be removed automatically if the file is bigger than the max size.

Steps to Reproduce

Set file maxSize, for example:

await request.saveRequestFiles({
  limits: {
    fileSize: 1, // 1 byte
  },
})

and after the error is thrown, call cleanRequestFiles.

Expected Behavior

The file should be cleared

Metadata

Metadata

Assignees

No one assigned

    Labels

    need infoMore information is needed to resolve this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions