Browse Source

Fix errors

Co-authored-by: Peter Lewis <[email protected]>
Co-authored-by: Philip H <[email protected]>
pull/1108/head
Bernd Storath 2 years ago
committed by Philip H
parent
commit
8942e2bd6d
  1. 1
      src/config.js
  2. 5
      src/lib/Server.js

1
src/config.js

@ -1,5 +1,6 @@
'use strict';
const childProcess = require('child_process');
const { release } = require('./package.json');
module.exports.RELEASE = release;

5
src/lib/Server.js

@ -241,13 +241,14 @@ module.exports = class Server {
await WireGuard.updateClientAddress({ clientId, address });
return { success: true };
}))
.put('/api/wireguard/client/:clientId/address6', Util.promisify(async (event) => {
.put('/api/wireguard/client/:clientId/address6', defineEventHandler(async (event) => {
const clientId = getRouterParam(event, 'clientId');
if (clientId === '__proto__' || clientId === 'constructor' || clientId === 'prototype') {
throw createError({ status: 403 });
}
const { address6 } = await readBody(event);
return WireGuard.updateClientAddress6({ clientId, address6 });
await WireGuard.updateClientAddress6({ clientId, address6 });
return { success: true };
}));
const safePathJoin = (base, target) => {

Loading…
Cancel
Save