Add CSP endpoint

This commit is contained in:
Pieter Vander Vennet 2024-07-19 20:43:46 +02:00
parent 1853af06a0
commit 9a517bd4f8
2 changed files with 52 additions and 32 deletions

View file

@ -7,7 +7,8 @@ export interface Handler {
handle: (
path: string,
queryParams: URLSearchParams,
req: http.IncomingMessage
req: http.IncomingMessage,
body: string | undefined
) => Promise<string>
}
@ -101,7 +102,7 @@ export class Server {
res.end()
return
}
let body = undefined
let body: string | undefined = undefined
if (req.method === "POST" || req.method === "UPDATE") {
body = await ServerUtils.getBody(req)
}