Hotspot: address review comments.

* POST /api/hotspot/settings checks is_docker_mode() directly instead of
  string-matching the error message (still 500, matching the sibling
  hotspot/bluetooth/throttle endpoints).
* Escape \ ; , " in the WiFi QR code per the WPA QR format.
* Skip the controller.yaml write when a settings update changes nothing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Roland 2026-07-04 08:56:12 -06:00
parent 0d2c13e4e7
commit 2887309aae
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
4 changed files with 27 additions and 8 deletions

View file

@ -1395,7 +1395,9 @@ function HotspotSettingsForm() {
.map(device => ({key: device, value: device, text: device}));
// Special string which allows a mobile device to connect to a specific Wi-Fi.
const qrCodeValue = `WIFI:S:${form.ssid};T:WPA;P:${form.password};;`;
// The WPA QR format requires backslash-escaping of \ ; , " in the SSID and password.
const escapeWifi = (s) => s.replace(/([\\;,"])/g, '\\$1');
const qrCodeValue = `WIFI:S:${escapeWifi(form.ssid)};T:WPA;P:${escapeWifi(form.password)};;`;
return <Form style={{marginLeft: '1em', marginBottom: '1em'}}>
<Form.Group widths='equal'>