/api/core/backup/download/this answers with config.xml, but get_config parsed it with .json(). That raised on every real device, the error was swallowed, and running came back empty. netOrk therefore never got an OPNsense configuration backup (NetOrk/netork#1016).
_get_text() returns the body as text, and get_config uses it.
A failed read now raises instead of returning "", so the caller sees the real reason (e.g. a 403).
New tests go through the real session path with an XML body. The old ones stubbed _get and so missed the bug.
`/api/core/backup/download/this` answers with `config.xml`, but `get_config` parsed it with `.json()`. That raised on every real device, the error was swallowed, and `running` came back empty. netOrk therefore never got an OPNsense configuration backup (NetOrk/netork#1016).
- `_get_text()` returns the body as text, and `get_config` uses it.
- A failed read now raises instead of returning `""`, so the caller sees the real reason (e.g. a 403).
- New tests go through the real session path with an XML body. The old ones stubbed `_get` and so missed the bug.
Verified read-only against `gw` (172.22.8.50): 200, `application/octet-stream`, 505 KB XML, `.json()` → `JSONDecodeError`.
Closes #11
/api/core/backup/download/this answers with config.xml itself, but
get_config went through _get(), which calls .json(). That raised on
every real device, the except swallowed it, and "running" came back
empty. The unit tests replaced _get with a lambda, so they never saw it.
_get_text() returns the body as text. A failed read now raises instead
of returning an empty string, so the caller sees why it failed.
Closes#11
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
/api/core/backup/download/thisanswers withconfig.xml, butget_configparsed it with.json(). That raised on every real device, the error was swallowed, andrunningcame back empty. netOrk therefore never got an OPNsense configuration backup (NetOrk/netork#1016)._get_text()returns the body as text, andget_configuses it."", so the caller sees the real reason (e.g. a 403)._getand so missed the bug.Verified read-only against
gw(172.22.8.50): 200,application/octet-stream, 505 KB XML,.json()→JSONDecodeError.Closes #11