Make queries case insensitivie
This commit is contained in:
parent
389f05f316
commit
f06f51b247
|
@ -46,7 +46,7 @@ proc present(req: Request, auth: Auth, base: string): Future[void] {.async.} =
|
||||||
|
|
||||||
addRecord(
|
addRecord(
|
||||||
records,
|
records,
|
||||||
(name: name, dtype: DnsType.TXT),
|
(name: name.toLowerAscii(), dtype: DnsType.TXT),
|
||||||
record.value
|
record.value
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ proc present(req: Request, auth: Auth, base: string): Future[void] {.async.} =
|
||||||
|
|
||||||
proc cleanup(req: Request, auth: Auth, base: string): Future[void] {.async.} =
|
proc cleanup(req: Request, auth: Auth, base: string): Future[void] {.async.} =
|
||||||
let record = to(parseJson(req.body), NewRecordReq)
|
let record = to(parseJson(req.body), NewRecordReq)
|
||||||
let name = trimName(record.fqdn) & "." & auth.name & "." & base
|
let name = trimName(record.fqdn.toLowerAscii()) & "." & auth.name & "." & base
|
||||||
|
|
||||||
echo &"Deleting TXT record for {name} with value {record.value}"
|
echo &"Deleting TXT record for {name} with value {record.value}"
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ proc handleDnsRequest(records: RecordsTable, data: string): Option[string] =
|
||||||
let response = mkResponse(
|
let response = mkResponse(
|
||||||
msg.header.id,
|
msg.header.id,
|
||||||
question,
|
question,
|
||||||
records.getOrDefault((name: question.qname, dtype: question.qtype), @[])
|
records.getOrDefault((name: question.qname.toLowerAscii(), dtype: question.qtype), @[])
|
||||||
)
|
)
|
||||||
|
|
||||||
echo response
|
echo response
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import tables, strtabs, sequtils, nativesockets
|
import tables, strtabs, sequtils, nativesockets, strutils
|
||||||
import ../lib/dns
|
import ../lib/dns
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
Loading…
Reference in New Issue