Closed Szymok closed 2 months ago
Thanks for reporting this!
I can't seem to replicate the issue on my end while using the same version of Pi-hole. Do you have a way of checking the full HTML response? I'm wondering if it's a 404 or something else.
This might have something to do with the lack or addition of /admin/
in the path. For me, this URL works:
https://url/admin/api.php?...
And this does not:
https://url/api.php?...
You should only specify the domain in the config, as I believe you already have.
OK, nvm, i found that i had in traefik configured middlewares to replace the admin and prefix to get a shorter URL. Everything works like a charm, thank you and sorry for bothering! :D
No problem, glad you got it sorted out. 😄
Pi-hole API Response Contains Invalid JSON
When fetching DNS stats at Glance from the Pi-hole API at
https://url/api.php?summaryRaw&topItems&overTimeData10mins&auth=token
, the response contains invalid JSON with the error "invalid character '<' looking for beginning of value".Expected Behavior
The Glance should return a valid graph response with the requested DNS statistics.
Actual Behavior
The API returns an HTML response instead of JSON, causing the error "invalid character '<' looking for beginning of value" when parsing the response.
Steps to Reproduce
Environment
Additional Information
The Pi-hole API endpoint is accessible and returns a valid JSON response when tested directly.
The Glance application is configured to use the correct URL and token.
Please let me know if you need any other information to investigate this issue.