Browse Source

fixup: Prototype-polluting assignment for ipv6

pull/781/head
Philip H 3 years ago
committed by GitHub
parent
commit
1f2b0acb60
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 13
      src/lib/Server.js

13
src/lib/Server.js

@ -158,11 +158,6 @@ module.exports = class Server {
const { name } = req.body;
return WireGuard.updateClientName({ clientId, name });
}))
.put('/api/wireguard/client/:clientId/address6', Util.promisify(async (req) => {
const { clientId } = req.params;
const { address6 } = req.body;
return WireGuard.updateClientAddress6({ clientId, address6 });
}))
.put('/api/wireguard/client/:clientId/address', Util.promisify(async (req, res) => {
const { clientId } = req.params;
if (clientId === '__proto__' || clientId === 'constructor' || clientId === 'prototype') {
@ -171,6 +166,14 @@ module.exports = class Server {
const { address } = req.body;
return WireGuard.updateClientAddress({ clientId, address });
}))
.put('/api/wireguard/client/:clientId/address6', Util.promisify(async (req) => {
const { clientId } = req.params;
if (clientId === '__proto__' || clientId === 'constructor' || clientId === 'prototype') {
res.end(403);
}
const { address6 } = req.body;
return WireGuard.updateClientAddress6({ clientId, address6 });
}))
.listen(PORT, WEBUI_HOST, () => {
debug(`Listening on http://${WEBUI_HOST}:${PORT}`);

Loading…
Cancel
Save