fastify / fastify/fastify-multipart

Support manual hook injection

Open
#599 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
539
Forks
126
PR merge metrics
No merged PRs in 30d

Description

### Prerequisites

- [x] I have written a descriptive issue title
- [x] I have searched existing issues to ensure the feature has not already been requested

### 🚀 Feature Proposal

I have multiple hooks during the preValidation step including hooks that modify the content or run a signature check on the content. Because the hook is registered at the instance boot and not at the route level i cannot decide on the hooks order.

https://github.com/fastify/fastify-multipart/blob/83aea9789d45a6222041a4fa33fd9535a179f4b9/index.js#L70

Would it be possible to put the hook in a dedicated exported function and add a new parameter to allow to manually load the hook via the function?

### Motivation

_No response_

### Example

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.