From 00fe0ff733059b045e3b17236f1b8ea311119c75 Mon Sep 17 00:00:00 2001 From: Vincent de Saboulin Date: Fri, 15 Dec 2023 17:13:12 +0100 Subject: [PATCH] delete --- connect/connect-http-sink/httpserver-oauth2/app.js | 9 +++++++++ connect/connect-http-sink/httpserver/server.js | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/connect/connect-http-sink/httpserver-oauth2/app.js b/connect/connect-http-sink/httpserver-oauth2/app.js index 8b0079d8b..48ed61812 100644 --- a/connect/connect-http-sink/httpserver-oauth2/app.js +++ b/connect/connect-http-sink/httpserver-oauth2/app.js @@ -57,6 +57,15 @@ app.put('/', authenticateRequest, (req, res) => { console.log(`[${new Date().toISOString()}] sending back ${errorCode}`); }); +app.delete('/', authenticateRequest, (req, res) => { + res.status(errorCode).json({ message: `Returned status: ${errorCode}` }); + console.log("headers:"); + console.log(req.headers); + console.log("body:"); + console.log(req.body); + console.log(`[${new Date().toISOString()}] sending back ${errorCode}`); +}); + app.put('/set-response-error-code', (req, res) => { if(req.body.errorCode && typeof req.body.errorCode === "number") { errorCode = req.body.errorCode; diff --git a/connect/connect-http-sink/httpserver/server.js b/connect/connect-http-sink/httpserver/server.js index 1dad3d533..33388fe56 100644 --- a/connect/connect-http-sink/httpserver/server.js +++ b/connect/connect-http-sink/httpserver/server.js @@ -46,6 +46,15 @@ app.put('/', (req, res) => { console.log(`[${new Date().toISOString()}] sending back ${errorCode}`); }); +app.delete('/', (req, res) => { + res.status(errorCode).json(responseBody); + console.log("headers:"); + console.log(req.headers); + console.log("body:"); + console.log(req.body); + console.log(`[${new Date().toISOString()}] sending back ${errorCode}`); +}); + app.put('/set-response-error-code', (req, res) => { if(req.body.errorCode && typeof req.body.errorCode === "number") { errorCode = req.body.errorCode;