Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't lowercase TXT records #57

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion aiodnsresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,8 @@ def rdata_expires_at(record, expires_at):
return \
IPv4AddressExpiresAt(record.rdata, expires_at) if record.qtype == TYPES.A else \
IPv6AddressExpiresAt(record.rdata, expires_at) if record.qtype == TYPES.AAAA else \
BytesExpiresAt(record.rdata.lower(), expires_at)
BytesExpiresAt(record.rdata.lower(), expires_at) if record.qtype == TYPES.CNAME else \
BytesExpiresAt(record.rdata, expires_at)

def rdata_expires_at_min(rdatas, expires_at):
return tuple(
Expand Down
2 changes: 2 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,8 @@ async def test_a_query_multiple(self):
async def test_txt_query(self):
resolve, _ = Resolver()
res = await resolve('charemza.name', TYPES.TXT)
all_lowercase = all(r == r.lower() for r in res)
self.assertFalse(all_lowercase)
self.assertIn(b'google', res[0])

@async_test
Expand Down