Ignore empty lines when parsing private keys (#911)

When migrating zones to CoreDNS, it did not accept private key files
the former bind setup gracefully accepted. It turned out they had a
trailing newline for whateveer reason. The dns library should handle
them gracefully, too.
This commit is contained in:
Jens Erat 2019-02-28 07:32:07 +01:00 committed by Miek Gieben
parent 12ac8fb6e8
commit 092d7745b4
1 changed files with 5 additions and 0 deletions

View File

@ -322,6 +322,11 @@ func (kl *klexer) Next() (lex, bool) {
commt = false
}
if kl.key && str.Len() == 0 {
// ignore empty lines
break
}
kl.key = true
l.value = zValue