Add Accept+XHR headers and raw-string response parsing for token endpoint

FixVOIPService
Shipped
April 26, 2026 at 2:49 AM UTC
Author
Kamo
Commit
7cbfc82

FreePBX was returning text/html when called via cluster DNS because the Host header didn't match the configured PBX_HOSTNAME. Adding Accept: application/json and X-Requested-With: XMLHttpRequest tells FreePBX to return JSON errors instead of redirecting to an HTML page. Switched from ResponseEntity<JsonNode> to ResponseEntity<String> with manual objectMapper.readTree() so non-JSON responses produce a clear diagnostic log line instead of an opaque HttpMessageConverter exception.

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing