From f7f255e20fae4868997217ea08739cef1096c1e8 Mon Sep 17 00:00:00 2001 From: rzuasti Date: Sun, 31 May 2026 18:32:40 -0400 Subject: [PATCH] Compare parsed /test response instead of stringified Dio dump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously BackendAPI.test() called response.toString().contains('OOTT_API_OK'), which scans the full stringified Response (status line, headers, body, request path). A reverse proxy or captive portal returning HTML that happens to echo the token would falsely pass the connectivity check. Compare response.data — the JSON-decoded String the backend's /api/test handler returns — against the expected value with exact equality instead. Co-Authored-By: Claude Sonnet 4.6 --- frontend/lib/utils/oott_api.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/utils/oott_api.dart b/frontend/lib/utils/oott_api.dart index 05c9a46..12a3e96 100644 --- a/frontend/lib/utils/oott_api.dart +++ b/frontend/lib/utils/oott_api.dart @@ -153,7 +153,7 @@ class BackendAPI { try { Response response = await dio.get('/test'); - return response.toString().contains('OOTT_API_OK') + return response.data == 'OOTT_API_OK' ? null : "URL successfully called but didn't return the expected value. Check your URL and make sure it points to your OOTT backend base URL."; } catch (e) {