Skip to content

Commit 093bd01

Browse files
authored
Merge pull request #57 from michalc/fix/no-lowercase-txt-records
fix: don't lowercase TXT records
2 parents d9313ab + b9f6a33 commit 093bd01

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

aiodnsresolver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,8 @@ def rdata_expires_at(record, expires_at):
605605
return \
606606
IPv4AddressExpiresAt(record.rdata, expires_at) if record.qtype == TYPES.A else \
607607
IPv6AddressExpiresAt(record.rdata, expires_at) if record.qtype == TYPES.AAAA else \
608-
BytesExpiresAt(record.rdata.lower(), expires_at)
608+
BytesExpiresAt(record.rdata.lower(), expires_at) if record.qtype == TYPES.CNAME else \
609+
BytesExpiresAt(record.rdata, expires_at)
609610

610611
def rdata_expires_at_min(rdatas, expires_at):
611612
return tuple(

test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,8 @@ async def test_a_query_multiple(self):
16881688
async def test_txt_query(self):
16891689
resolve, _ = Resolver()
16901690
res = await resolve('charemza.name', TYPES.TXT)
1691+
all_lowercase = all(r == r.lower() for r in res)
1692+
self.assertFalse(all_lowercase)
16911693
self.assertIn(b'google', res[0])
16921694

16931695
@async_test

0 commit comments

Comments
 (0)