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
e1d0b63e
Commit
e1d0b63e
authored
Jun 01, 2019
by
Chris O'Haver
Committed by
Miek Gieben
Jun 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow an empty response (#2855)
parent
3b3fb6f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
plugin/template/setup.go
plugin/template/setup.go
+0
-4
plugin/template/setup_test.go
plugin/template/setup_test.go
+7
-7
No files found.
plugin/template/setup.go
View file @
e1d0b63e
...
@@ -155,10 +155,6 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) {
...
@@ -155,10 +155,6 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) {
t
.
regex
=
append
(
t
.
regex
,
regexp
.
MustCompile
(
".*"
))
t
.
regex
=
append
(
t
.
regex
,
regexp
.
MustCompile
(
".*"
))
}
}
if
len
(
t
.
answer
)
==
0
&&
len
(
t
.
authority
)
==
0
&&
t
.
rcode
==
dns
.
RcodeSuccess
{
return
handler
,
c
.
Errf
(
"no answer section for template found: %v"
,
handler
)
}
handler
.
Templates
=
append
(
handler
.
Templates
,
t
)
handler
.
Templates
=
append
(
handler
.
Templates
,
t
)
}
}
...
...
plugin/template/setup_test.go
View file @
e1d0b63e
...
@@ -36,13 +36,6 @@ func TestSetupParse(t *testing.T) {
...
@@ -36,13 +36,6 @@ func TestSetupParse(t *testing.T) {
{
`template X`
,
true
},
{
`template X`
,
true
},
{
`template ANY`
,
true
},
{
`template ANY`
,
true
},
{
`template ANY X`
,
true
},
{
`template ANY X`
,
true
},
{
`template ANY ANY (?P<x>`
,
true
},
{
`template ANY ANY {
}`
,
true
,
},
{
{
`template ANY ANY .* {
`template ANY ANY .* {
notavailable
notavailable
...
@@ -92,6 +85,13 @@ func TestSetupParse(t *testing.T) {
...
@@ -92,6 +85,13 @@ func TestSetupParse(t *testing.T) {
true
,
true
,
},
},
// examples
// examples
{
`template ANY ANY (?P<x>`
,
false
},
{
`template ANY ANY {
}`
,
false
,
},
{
{
`template ANY A example.com {
`template ANY A example.com {
match ip-(?P<a>[0-9]*)-(?P<b>[0-9]*)-(?P<c>[0-9]*)-(?P<d>[0-9]*)[.]example[.]com
match ip-(?P<a>[0-9]*)-(?P<b>[0-9]*)-(?P<c>[0-9]*)-(?P<d>[0-9]*)[.]example[.]com
...
...
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