Jonas Zürcher and neil
ae8ef74c4b
fix(dns_infomaniak): correctly detect API errors ( #7048 )
...
The add/rm success check never rejected anything: for any non-empty API
response it always reported "Record added"/"Record deleted" and returned
0, so the _err branch was dead code. A valid key looked fine only because
the API call genuinely created the record; an invalid key returning
{"result":"error"} produced the same "Record added" output even though
nothing was created.
Root cause, in:
if [ -n "$response" ]; then
if [ ! "$(echo "$response" | _contains '"result":"success"')" ]; then
- _contains() ignores stdin (it reads only $1 and $2), so the piped
"$response" was discarded.
- The pattern '"result":"success"' was passed as $1 (the haystack),
leaving $2 (the needle) empty, so it ran:
echo '"result":"success"' | grep -- "" >/dev/null 2>&1
grep with an empty pattern always matches.
- That grep output is redirected to /dev/null, so the command
substitution always captured "", making [ ! "" ] always true.
Fix: call _contains "$response" '"result":"success"' directly and branch
on its exit code, so error responses now correctly fail (return 1).
Co-authored-by: neil <github@neilpang.com >
History
..
2026-06-05 19:28:08 +02:00
2024-05-18 12:06:41 +03:00
2024-05-18 12:06:41 +03:00
2025-05-05 15:48:02 +02:00
2024-10-13 17:41:22 +02:00
2025-12-06 11:23:28 +01:00
2024-11-09 18:22:01 +02:00
2024-10-13 17:41:22 +02:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2026-06-05 22:06:49 +02:00
2024-10-13 17:41:22 +02:00
2025-03-31 10:47:49 -04:00
2026-04-14 20:44:30 +08:00
2025-08-12 11:12:09 +03:00
2026-03-22 11:36:29 +08:00
2026-04-08 21:59:09 +08:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:55:22 +02:00
2026-06-05 22:02:14 +02:00
2025-11-20 00:29:44 +08:00
2024-05-18 12:06:41 +03:00
2025-05-31 15:02:25 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2025-08-12 19:04:19 +02:00
2026-04-26 14:29:40 +02:00
2024-05-18 12:06:41 +03:00
2025-11-03 18:14:27 +01:00
2026-01-14 21:05:32 +01:00
2026-03-16 20:17:18 +08:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2026-07-01 18:54:24 +08:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:49:29 +02:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:49:29 +02:00
2024-05-18 12:06:41 +03:00
2024-05-27 12:45:01 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-05-18 12:06:41 +03:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2026-01-10 01:44:07 +01:00
2025-08-12 11:12:09 +03:00
2025-05-19 15:08:54 +03:00
2024-05-18 12:06:41 +03:00
2025-11-25 14:47:40 +01:00
2026-05-02 10:56:13 +02:00
2024-10-13 17:41:22 +02:00
2025-12-09 09:49:54 +01:00
2026-05-02 10:56:13 +02:00
2025-03-11 08:07:38 +00:00
2025-08-12 11:12:09 +03:00
2025-05-19 15:15:46 +03:00
2025-12-08 19:02:33 +01:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:49:29 +02:00
2026-04-14 20:57:22 +08:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:49:29 +02:00
2025-11-02 04:07:58 +01:00
2024-10-13 17:41:22 +02:00
2024-05-18 12:06:41 +03:00
2026-07-01 20:44:21 +08:00
2024-08-23 16:00:08 +08:00
2025-11-30 00:49:36 +01:00
2024-05-18 12:06:41 +03:00
2026-07-01 21:05:07 +08:00
2024-10-13 17:49:29 +02:00
2025-12-20 14:53:01 +01:00
2024-11-09 18:31:52 +02:00
2024-10-13 17:41:22 +02:00
2026-05-24 22:24:00 +02:00
2024-05-18 12:06:41 +03:00
2024-07-31 16:22:12 +02:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2024-05-18 12:06:41 +03:00
2024-05-18 12:06:41 +03:00
2024-05-18 12:06:41 +03:00
2025-07-02 21:15:46 +08:00
2024-05-18 12:06:41 +03:00
2026-06-29 01:27:41 +08:00
2024-05-18 12:06:41 +03:00
2024-12-31 11:45:29 +02:00
2024-11-08 00:59:21 -03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:49:29 +02:00
2026-03-08 18:37:29 +08:00
2025-12-08 19:31:40 +01:00
2024-10-16 11:49:29 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2024-12-31 11:45:29 +02:00
2024-05-18 12:06:41 +03:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:55:22 +02:00
2025-08-12 11:12:09 +03:00
2026-06-19 14:24:20 +02:00
2025-10-14 15:51:28 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-11-17 20:58:06 +01:00
2024-10-13 17:58:19 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-05-18 12:06:41 +03:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:41:22 +02:00
2026-02-12 15:32:53 +01:00
2024-10-13 17:58:19 +02:00
2024-10-13 17:41:22 +02:00
2025-12-17 17:15:10 -05:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2025-08-12 11:12:09 +03:00
2024-12-31 11:45:29 +02:00
2024-05-18 12:06:41 +03:00
2025-09-15 15:50:48 +10:00
2026-01-23 09:20:00 +01:00
2025-10-14 10:10:19 +02:00
2024-12-31 11:45:29 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2026-05-24 22:34:56 +02:00
2025-12-30 16:31:16 -05:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-07-05 09:23:14 +02:00
2024-10-13 17:49:29 +02:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:58:19 +02:00
2025-08-12 11:12:09 +03:00
2025-08-12 11:12:09 +03:00
2024-05-18 12:06:41 +03:00
2024-10-13 17:59:25 +02:00
2026-05-24 22:20:40 +02:00
2026-04-08 22:07:30 +08:00
2025-12-24 17:19:17 +03:30
2025-08-12 11:12:09 +03:00
2026-03-22 11:40:44 +08:00
2026-03-03 05:31:51 -08:00
2025-08-12 11:12:09 +03:00
2025-05-23 17:54:56 +08:00
2025-08-12 11:12:09 +03:00
2025-05-16 15:40:36 +02:00
2025-08-12 11:12:09 +03:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2025-08-15 09:02:57 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2026-01-04 16:33:37 +03:30
2025-08-12 11:12:09 +03:00
2025-08-12 11:12:09 +03:00
2025-08-12 11:12:09 +03:00
2024-12-28 22:31:24 +02:00
2026-04-08 22:00:42 +08:00
2024-12-31 11:45:29 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-12-28 17:42:58 +02:00
2024-05-18 12:06:41 +03:00
2020-01-30 12:06:39 +08:00