Commit Graph
2 Commits
Author SHA1 Message Date
Daniel efdd560ee4 API: Differentiate bad TXT update error.
Previous to this commit, if the update message had a valid subdomain but
an invalid TXT the error returned was for a bad subdomain. This can
confuse developers who were POSTing junk TXT records to test acme-dns
:-)

This commit adjusts the `webUpdatePost` error handling such that
`!validSubdomain(input)` and `!validTXT(input)` give distinct errors.

The `!validSubdomain` case should never happen in `webUpdatePost`
because `auth.go`'s `Auth` function already vets the post data
subdomain but I retained the error handling code just in case.

Unit tests for an update with an invalid subdomain and an update with an
invalid TXT are included.
2018-02-27 19:26:15 -05:00
Daniel McCarneyandJoona Hoikkala 0ec12dbc5f Update README json examples. (#12)
This commit fixes the JSON examples in the README. There was a missing
`]` in the example input, a missing IP range in the reflected output,
and a few trailing `,` that shouldn't have been there.
2017-09-01 09:37:22 +03:00