Skip to content

Fix SRV with @ name on apex generating invalid host (#29) - #52

Merged
pawel-kow merged 3 commits into
masterfrom
pawel-kow/issue29
Sep 25, 2026
Merged

pawel-kow merged 3 commits into
masterfrom
pawel-kow/issue29

Conversation

@pawel-kow

Copy link
Copy Markdown
Member

Summary

If an SRV template record has name: "@" and the template is applied without a host, process_records built the host _<proto>.@ for validation and raised InvalidData. The @ is now left off so only _<proto> is validated. The record is stored with name: "@", 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_apex
  • param_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_host now expects name: "@", data: foo.com

param_var_prefix_in_host_srv_empty_raises (%var%._tcp with an empty var) still expects InvalidData, because the empty leading label makes the name invalid.

All 370 tests pass.

Fixes #29

🤖 Generated with Claude Code

pawel-kow and others added 2 commits September 25, 2026 20:32
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>
@pawel-kow
pawel-kow merged commit ff6e2f3 into master Sep 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: @ in name of SRV not accepted on apex

1 participant