Skip to content

Commit 80a78fb

Browse files
committed
fix remove cross site scripting
1 parent 89d0d1f commit 80a78fb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/routes/pipelines.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,16 @@ Router.delete('/cli/pipelines/:pipeline/:phase/:app', bearerMiddleware, async fu
153153
await req.app.locals.kubero.deleteApp(req.params.pipeline, req.params.phase, req.params.app);
154154

155155
// sanityze params
156-
req.params.pipeline = encodeURI(req.params.pipeline);
157-
req.params.phase = encodeURI(req.params.phase);
158-
req.params.app = encodeURI(req.params.app);
159-
res.send("deleted "+req.params.pipeline+" "+req.params.phase+" "+req.params.app);
156+
const pipeline = encodeURI(req.params.pipeline);
157+
const phase = encodeURI(req.params.phase);
158+
const app = encodeURI(req.params.app);
159+
const response = {
160+
message: "deleted "+pipeline+" "+phase+" "+app,
161+
pipeline: pipeline,
162+
phase: phase,
163+
app: app
164+
};
165+
res.send(response);
160166
});
161167

162168
Router.put('/pipelines/:pipeline/:phase/:app', authMiddleware, async function (req: Request, res: Response) {

0 commit comments

Comments
 (0)