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:
parent
5d84523f5b
commit
6ee0baab56
|
@ -7,6 +7,7 @@
|
||||||
* Make compare/split labels faster
|
* Make compare/split labels faster
|
||||||
* Ratelimiting?
|
* Ratelimiting?
|
||||||
* Have infrastructure to keep track of outbound queries and hold some
|
* Have infrastructure to keep track of outbound queries and hold some
|
||||||
|
* Check if \DDD is properly parsed: text/network/etc.
|
||||||
|
|
||||||
## Nice to have
|
## Nice to have
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,11 @@ func IsDomainName(s string) (uint8, uint8, bool) { // copied from net package.
|
||||||
c = s[i]
|
c = s[i]
|
||||||
switch {
|
switch {
|
||||||
default:
|
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 == '/':
|
case 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c == '*' || c == '/':
|
||||||
ok = true
|
ok = true
|
||||||
partlen++
|
partlen++
|
||||||
|
|
Loading…
Reference in New Issue