summaryrefslogtreecommitdiff
path: root/server.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'server.mjs')
-rw-r--r--server.mjs5
1 files changed, 2 insertions, 3 deletions
diff --git a/server.mjs b/server.mjs
index ff9d7ba..844430e 100644
--- a/server.mjs
+++ b/server.mjs
@@ -30,10 +30,9 @@ const getTimeControlller = (req, res) => {
const eagleController = (req, res) => {
const [, query] = req.url.split('?')
const params = new URLSearchParams(query)
- const mac = params.get('mac')
- const key = params.get('key')
+ const { mac, key } = JSON.parse(params.get('params') || '{}')
- if (mac === null || key === null) {
+ if (mac === undefined || key === undefined) {
res.writeHead(400, { 'Content-Type': 'application/json' })
res.end('{}\n')
return