Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
27e22b06
Commit
27e22b06
authored
Sep 25, 2019
by
Miek Gieben
Committed by
corbot[bot]
Sep 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use strings.ToLower in server (#3304)
Automatically submitted.
parent
eb59e792
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
core/dnsserver/server.go
core/dnsserver/server.go
+9
-17
No files found.
core/dnsserver/server.go
View file @
27e22b06
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"fmt"
"fmt"
"net"
"net"
"runtime"
"runtime"
"strings"
"sync"
"sync"
"time"
"time"
...
@@ -217,27 +218,18 @@ func (s *Server) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
...
@@ -217,27 +218,18 @@ func (s *Server) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
return
return
}
}
q
:=
r
.
Question
[
0
]
.
Name
b
:=
make
([]
byte
,
len
(
q
))
var
off
int
var
end
bool
var
dshandler
*
Config
// Wrap the response writer in a ScrubWriter so we automatically make the reply fit in the client's buffer.
// Wrap the response writer in a ScrubWriter so we automatically make the reply fit in the client's buffer.
w
=
request
.
NewScrubWriter
(
r
,
w
)
w
=
request
.
NewScrubWriter
(
r
,
w
)
for
{
q
:=
strings
.
ToLower
(
r
.
Question
[
0
]
.
Name
)
l
:=
len
(
q
[
off
:
])
var
(
for
i
:=
0
;
i
<
l
;
i
++
{
off
int
b
[
i
]
=
q
[
off
+
i
]
end
bool
// normalize the name for the lookup
dshandler
*
Config
if
b
[
i
]
>=
'A'
&&
b
[
i
]
<=
'Z'
{
)
b
[
i
]
|=
(
'a'
-
'A'
)
}
}
if
h
,
ok
:=
s
.
zones
[
string
(
b
[
:
l
])];
ok
{
for
{
if
h
,
ok
:=
s
.
zones
[
q
[
off
:
]];
ok
{
if
r
.
Question
[
0
]
.
Qtype
!=
dns
.
TypeDS
{
if
r
.
Question
[
0
]
.
Qtype
!=
dns
.
TypeDS
{
if
h
.
FilterFunc
==
nil
{
if
h
.
FilterFunc
==
nil
{
rcode
,
_
:=
h
.
pluginChain
.
ServeDNS
(
ctx
,
w
,
r
)
rcode
,
_
:=
h
.
pluginChain
.
ServeDNS
(
ctx
,
w
,
r
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment