summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--main.mjs4
1 files changed, 3 insertions, 1 deletions
diff --git a/main.mjs b/main.mjs
index 857fd34..3baeaed 100644
--- a/main.mjs
+++ b/main.mjs
@@ -853,7 +853,9 @@ class SuccessForm extends Form {
// We are using HTTP because the domain name is remapped to our local
// mock server, and the communication between the device and our mock
// server utilizes the HTTP protocol as well.
- const response = await fetch(`http://i.airmx.cn/exchange?device=${this.#deviceId}`)
+ const response = await fetch(`http://i.airmx.cn/exchange?device=${this.#deviceId}`, {
+ signal: AbortSignal.timeout(3000)
+ })
if (! response.ok) {
throw new Error('Could not retrieve the device key.')