mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
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:
co-authored by
Claude Sonnet 4.6
parent
8e9e221048
commit
f7f255e20f
@@ -153,7 +153,7 @@ class BackendAPI {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Response response = await dio.get('/test');
|
Response response = await dio.get('/test');
|
||||||
return response.toString().contains('OOTT_API_OK')
|
return response.data == 'OOTT_API_OK'
|
||||||
? null
|
? 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.";
|
: "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) {
|
} catch (e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user