mirror of
https://github.com/acme-dns/acme-dns.git
synced 2026-04-27 04:45:48 +03:00
[PR #42] [MERGED] API: Differentiate bad TXT update error. #265
Labels
No labels
Documentation
Documentation
bug
enhancement
feature request
feature request
help wanted
pull-request
question
security
security
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/acme-dns#265
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/acme-dns/acme-dns/pull/42
Author: @cpu
Created: 2/28/2018
Status: ✅ Merged
Merged: 3/13/2018
Merged by: @joohoi
Base:
master← Head:cpu-differentiate-errors📝 Commits (3)
efdd560API: Differentiate bad TXT update error.f463d07Merge branch 'master' into cpu-differentiate-errors92f8cc2Merge branch 'master' into cpu-differentiate-errors📊 Changes
2 files changed (+72 additions, -5 deletions)
View changed files
📝
api.go(+12 -5)📝
api_test.go(+60 -0)📄 Description
Previous to this commit, if the update message had a valid subdomain but
an invalid TXT value the error returned was for a bad subdomain. This can
confuse developers who were POSTing junk TXT records to test
acme-dns😊Only TXT values that are exactly 43 chars are considered valid:
github.com/joohoi/acme-dns@830cceb62c/validation.go (L37-L40)This commit adjusts the
webUpdatePosterror handling such that!validSubdomain(input)and!validTXT(input)give distinct errors.The
!validSubdomaincase should never happen inwebUpdatePostbecause
auth.go'sAuthfunction already vets the post datasubdomain 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.
I did my best to match the repo style for the code/tests but I admit
to hacking this together quickly without having read most of the codebase
yet! Please critique liberally.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.