From 0a5be146ff304bde616fe48617ebe25beb2cdce6 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 20 Jul 2024 16:30:39 +0200 Subject: [PATCH] Fix error reporting service --- scripts/serverErrorReport.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/serverErrorReport.ts b/scripts/serverErrorReport.ts index a9e845e4d1..acc0c848aa 100644 --- a/scripts/serverErrorReport.ts +++ b/scripts/serverErrorReport.ts @@ -24,7 +24,7 @@ class ServerErrorReport extends Script { ".lines.json" } - public reportError(path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined, logDirectory: string) { + public reportError(path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined, logDirectory: string): string { if (!body) { throw "{\"error\": \"No body; use a post request\"}" } @@ -83,15 +83,15 @@ class ServerErrorReport extends Script { { mustMatch: "report", mimetype: "application/json", - handle(path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined) { - return this.reportError(queryParams, req, body, logDirectory) + handle: async (path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined) => { + return this.reportError(path, queryParams, req, body, logDirectory) }, }, { mustMatch: "csp", mimetype: "application/json", - handle(path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined) { - return this.reportError(queryParams, req, body, logDirectory+"/csp") + handle: async (path: string, queryParams: URLSearchParams, req: IncomingMessage, body: string | undefined) => { + return this.reportError(path, queryParams, req, body, logDirectory+"/csp") }, }, ])