@rubytech/create-maxy 1.0.787 → 1.0.788
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -603,6 +603,7 @@ function handleRequest(req, res) {
|
|
|
603
603
|
|
|
604
604
|
// API: POST /connect — submit WiFi credentials
|
|
605
605
|
if (pathname === "/connect" && req.method === "POST") {
|
|
606
|
+
console.error(`[wifi-provision-server] /connect POST received connecting-flag=${connecting}`);
|
|
606
607
|
if (connecting) {
|
|
607
608
|
res.writeHead(409, { "Content-Type": "application/json" });
|
|
608
609
|
res.end('{"error":"Connection already in progress"}');
|
|
@@ -655,21 +656,11 @@ function handleRequest(req, res) {
|
|
|
655
656
|
// Use async open+write to avoid blocking the event loop (a FIFO
|
|
656
657
|
// write blocks until a reader opens the other end).
|
|
657
658
|
connecting = true;
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
// mutually exclusive on a single radio: as soon as the bash
|
|
661
|
-
// script tears down hostapd to run `nmcli connect`, the phone
|
|
662
|
-
// loses its connection to 192.168.4.1 and any subsequent
|
|
663
|
-
// `/result` poll dies. The success page must be in the phone's
|
|
664
|
-
// hands BEFORE the AP goes away. We send the hostname (.local
|
|
665
|
-
// resolution works on iOS/macOS) and the operator can paste
|
|
666
|
-
// the URL into a browser if .local fails on their device.
|
|
667
|
-
res.writeHead(200, { "Content-Type": "application/json" });
|
|
659
|
+
console.error(`[wifi-provision-server] /connect ssid=${JSON.stringify(ssid)} → 200 sync-success hostname=${HOSTNAME}`);
|
|
660
|
+
res.writeHead(200, { "Content-Type": "application/json", "Cache-Control": "no-store" });
|
|
668
661
|
res.end(JSON.stringify({
|
|
669
662
|
success: true,
|
|
670
663
|
hostname: HOSTNAME,
|
|
671
|
-
// ip is intentionally absent: we don't yet know the new
|
|
672
|
-
// home-WiFi IP and the AP IP (192.168.4.1) is about to die.
|
|
673
664
|
}));
|
|
674
665
|
|
|
675
666
|
const fifoData = `${ssid}\n${password}`;
|
|
@@ -723,7 +714,12 @@ function handleRequest(req, res) {
|
|
|
723
714
|
res.end();
|
|
724
715
|
return;
|
|
725
716
|
}
|
|
726
|
-
res.writeHead(200, {
|
|
717
|
+
res.writeHead(200, {
|
|
718
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
719
|
+
"Cache-Control": "no-store, no-cache, must-revalidate",
|
|
720
|
+
"Pragma": "no-cache",
|
|
721
|
+
"Expires": "0",
|
|
722
|
+
});
|
|
727
723
|
res.end(portalHTML());
|
|
728
724
|
}
|
|
729
725
|
|