summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Zhineng <[email protected]>2025-07-02 20:42:18 +0800
committerLi Zhineng <[email protected]>2025-07-02 20:42:18 +0800
commit40085a4679d88d2c0a141b95ee6818ac7420dae3 (patch)
treea91673aba254eab609f086d203fd1fe5c90c36bb
parent4abaac6c5df21a68d1ace7bcaee1e016a9edd90f (diff)
downloadserver-40085a4679d88d2c0a141b95ee6818ac7420dae3.tar.gz
server-40085a4679d88d2c0a141b95ee6818ac7420dae3.zip
improve mac and key checking
-rw-r--r--server.mjs3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.mjs b/server.mjs
index 18c6ee6..2475442 100644
--- a/server.mjs
+++ b/server.mjs
@@ -46,7 +46,8 @@ const eagleGenIdController = (req, res) => {
const params = new URLSearchParams(query)
const { mac, key } = JSON.parse(params.get('params') || '{}')
- if (mac === undefined || key === undefined) {
+ if (mac === undefined || mac === null
+ || key === undefined || key === null) {
res.writeHead(400, { 'Content-Type': 'application/json' })
res.end('{}\n')
return