Compare parsed /test response instead of stringified Dio dump

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 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-05-31 18:32:40 -04:00
co-authored by Claude Sonnet 4.6
parent 8e9e221048
commit f7f255e20f
+1 -1
View File
@@ -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) {