Files
acme.sh/dnsapi
T
Jonas Zürcherandneil 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>
ae8ef74c4b · 2026-07-01 21:05:07 +08:00
History
..
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-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:41:22 +02:00
2026-03-22 11:36:29 +08:00
2026-04-08 21:59:09 +08: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-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2025-11-03 18:14:27 +01:00
2026-01-14 21:05:32 +01:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:49:29 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:49:29 +02: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-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2026-01-10 01:44:07 +01: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
2024-10-13 17:41:22 +02:00
2024-10-13 17:49:29 +02:00
2024-10-13 17:41:22 +02:00
2024-08-23 16:00:08 +08:00
2024-10-13 17:49:29 +02:00
2024-10-13 17:41:22 +02:00
2024-07-31 16:22:12 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2025-07-02 21:15:46 +08: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
2024-10-16 11:49:29 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:55:22 +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-10-13 17:41:22 +02: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-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +02:00
2024-10-13 17:41:22 +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-10-13 17:49:29 +02:00
2024-10-13 17:58:19 +02:00
2024-10-13 17:59:25 +02:00
2026-05-24 22:20:40 +02:00
2026-03-03 05:31:51 -08: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:41:22 +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
2020-01-30 12:06:39 +08:00