Skip to content

Commit 8f401fb

Browse files
leenrbuglloc
authored andcommitted
Lower label's case before processing
E.g. Google Public DNS randomizes case in the requests it sends. For example, `8ba299a7.v4-ttl-5s.8ba299a8.v4-cnt-5.loop.example.com.` may become `8BA299a7.V4-ttl-5s.8BA299A8.V4-cNt-5.lOOP.ExAmPLE.cOm.`, (taken from the real request Google Public DNS has sent to me). This commits makes so RIP can successfully parse requests regardless of the case.
1 parent 4fa518e commit 8f401fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/handlers/parser/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func NewParser(fqdn, zone string) *Parser {
3737
ripReq = fqdn[:len(fqdn)-len(zone)-1]
3838
}
3939

40-
labels := strings.Split(ripReq, ".")
40+
labels := strings.Split(strings.ToLower(ripReq), ".")
4141
slices.StringsReverse(labels)
4242
return &Parser{
4343
cur: 0,

0 commit comments

Comments
 (0)