Skip to content
Snippets Groups Projects
Select Git revision
2 results Searching

api.go

Blame
  • user avatar
    Daniel authored
    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.
    efdd560e
    History