Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alihm committed Apr 3, 2024
1 parent ee8711a commit 1f3a3fc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ClusterOperator/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const log = require('../lib/log');
const utill = require('../lib/utill');
const config = require('./config');
const Security = require('./Security');
const fluxAPI = require('../lib/fluxAPI');
const SqlImporter = require('../modules/mysql-import');

/**
Expand Down Expand Up @@ -205,7 +204,7 @@ function startUI() {
chunk: count++,
})}\r\n\r\n`);
await timer.setTimeout(2000);
//console.log(count);
// console.log(count);
}
});

Expand Down Expand Up @@ -262,13 +261,13 @@ function startUI() {
}
});

app.get('/secret/:key', (req, res) => {
app.get('/secret/:key', async (req, res) => {
const remoteIp = utill.convertIP(req.ip);
const whiteList = config.whiteListedIps.split(',');
if (whiteList.length) {
if (whiteList.includes(remoteIp)) {
const { key } = req.params;
const value = BackLog.getKey(`_sk${key}`);
const value = await BackLog.getKey(`_sk${key}`);
if (value) {
res.send(value);

Check warning

Code scanning / CodeQL

Exception text reinterpreted as HTML Medium

Exception text
is reinterpreted as HTML without escaping meta-characters.
} else {
Expand All @@ -278,7 +277,7 @@ function startUI() {
}
});

app.post('/secret/', (req, res) => {
app.post('/secret/', async (req, res) => {
const remoteIp = utill.convertIP(req.ip);
const whiteList = config.whiteListedIps.split(',');
let secret = req.body;
Expand All @@ -287,7 +286,7 @@ function startUI() {
if (whiteList.length) {
if (whiteList.includes(remoteIp)) {
secret = req.body;
value = BackLog.pushKey(`_sk${secret.key}`, secret.value, true);
const value = await BackLog.pushKey(`_sk${secret.key}`, secret.value, true);
if (value) {
res.send('OK');
}
Expand Down

0 comments on commit 1f3a3fc

Please sign in to comment.