anything escaped in domain name is legal

Allow all character after a \ in a domainname. It's escaped, it's
legal.
This commit is contained in:
Miek Gieben 2013-06-13 19:41:37 +01:00
parent 5d84523f5b
commit 6ee0baab56
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,7 @@
* Make compare/split labels faster
* Ratelimiting?
* Have infrastructure to keep track of outbound queries and hold some
* Check if \DDD is properly parsed: text/network/etc.
## Nice to have

View File

@ -189,7 +189,11 @@ func IsDomainName(s string) (uint8, uint8, bool) { // copied from net package.
c = s[i]
switch {
default:
return 0, uint8(l - longer), false
// anything escaped is legal
if last != '\\' {
return 0, uint8(l - longer), false
}
partlen++
case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c == '*' || c == '/':
ok = true
partlen++