summaryrefslogtreecommitdiff
path: root/packages/backend/src/server
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-05-06 18:46:08 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-05-08 11:23:20 -0400
commitcbe88122b9c1446a61d69082df8f0ba729837a08 (patch)
treefef3e7835c0e97108128ea7796b62a5a8fb1610a /packages/backend/src/server
parentfix multipart/form-data decoding (diff)
downloadsharkey-cbe88122b9c1446a61d69082df8f0ba729837a08.tar.gz
sharkey-cbe88122b9c1446a61d69082df8f0ba729837a08.tar.bz2
sharkey-cbe88122b9c1446a61d69082df8f0ba729837a08.zip
fix hook targets
Diffstat (limited to 'packages/backend/src/server')
-rw-r--r--packages/backend/src/server/ServerUtilityService.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/backend/src/server/ServerUtilityService.ts b/packages/backend/src/server/ServerUtilityService.ts
index d90b37ca50..115717534f 100644
--- a/packages/backend/src/server/ServerUtilityService.ts
+++ b/packages/backend/src/server/ServerUtilityService.ts
@@ -28,7 +28,7 @@ export class ServerUtilityService {
// Default behavior saves files to memory - we don't want that!
// Store to temporary file instead, and copy the body fields while we're at it.
- fastify.addHook<{ Body?: Record<string, string | string[] | undefined> }>('onRequest', async request => {
+ fastify.addHook<{ Body?: Record<string, string | string[] | undefined> }>('preValidation', async request => {
if (request.isMultipart()) {
// We can't use saveRequestFiles() because it erases all the data fields.
// Instead, recreate it manually.
@@ -94,7 +94,7 @@ export class ServerUtilityService {
}
public addCORS(fastify: FastifyInstance) {
- fastify.addHook('onRequest', (_, reply, done) => {
+ fastify.addHook('preHandler', (_, reply, done) => {
// Allow web-based clients to connect from other origins.
reply.header('Access-Control-Allow-Origin', '*');