Repository navigation
Fix SRV with @ name on apex generating invalid host (#29) - #52
Merged
Merged
Conversation
When an SRV template record has name '@' and the template is applied without a host, the host used for validation was built as '_<proto>.@', which is invalid. The '@' part is now omitted so only '_<proto>' is validated, and the record is stored with name '@'. Tests that encoded the buggy behaviour are updated to expect success: - exception_srv_at_on_apex -> srv_at_name_on_apex - param_var_in_host_srv_empty_raises -> param_var_in_host_srv_empty_resolves_to_apex - param_at_in_target_srv_without_host Fixes #29 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SRV host used for validation was built from the raw protocol value, so a template with protocol "%var%" failed with "Invalid data for SRV host: _%var%". Protocol resolution and validation now run before the host is built, and the host uses the normalised protocol. Adds the semantically new SRV tests from PR #44 to process_records_tests.yaml: - srv_underscore_service_and_protocol_on_apex - srv_protocol_and_service_variables - exception_srv_empty_label_in_name - exception_srv_empty_protocol Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
If an SRV template record has
name: "@"and the template is applied without a host,process_recordsbuilt the host_<proto>.@for validation and raisedInvalidData. The@is now left off so only_<proto>is validated. The record is stored withname: "@", the same as other record types at the apex.Tests
I changed three YAML compliance tests that expected the buggy behaviour. Each failed with
Invalid data for SRV host: _udp.@before the fix:exception_srv_at_on_apex→srv_at_name_on_apexparam_var_in_host_srv_empty_raises→param_var_in_host_srv_empty_resolves_to_apex(now matches A/AAAA/TXT/MX/NS/CAA)param_at_in_target_srv_without_hostnow expectsname: "@",data: foo.comparam_var_prefix_in_host_srv_empty_raises(%var%._tcpwith an emptyvar) still expectsInvalidData, because the empty leading label makes the name invalid.All 370 tests pass.
Fixes #29
🤖 Generated with Claude Code