[WebUI] Fix BLE config page connection reset on load (#2295)
ble_script is defined as "" (empty string). Passing it to
server.sendContent("") signals end of HTTP chunked transfer,
closing the response prematurely. All subsequent chunks then
fail with errno 104 "Connection reset by peer".
Guard the call with a length check so the empty string is
never sent as a chunk terminator.
Co-authored-by: Florian <1technophile@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 file changed
+3
-1
+3
-1
@@ -1089,7 +1089,9 @@ void handleBL() {
|
||||
serializeJson(modules, jsonChar, measureJson(modules) + 1);
|
||||
beginChunkedResponse();
|
||||
sendHeaderChunk((String(gateway_name) + " - Configure BLE").c_str());
|
||||
server.sendContent(ble_script);
|
||||
if (strlen(ble_script) > 0) {
|
||||
server.sendContent(ble_script);
|
||||
}
|
||||
server.sendContent(script);
|
||||
server.sendContent(style);
|
||||
|
||||
|
||||
Reference in new issue
Block a user