mirror of
https://github.com/coredns/coredns.git
synced 2025-11-13 07:22:16 -05:00
Add middleware.NextOrFailure (#462)
This checks if the next middleware to be called is nil, and if so returns ServerFailure and an error. This makes the next calling more robust and saves some lines of code. Also prefix the error with the name of the middleware to aid in debugging.
This commit is contained in:
@@ -2,6 +2,7 @@ package debug
|
||||
|
||||
import "strings"
|
||||
|
||||
// Name is the domain prefix we check for when it is a debug query.
|
||||
const Name = "o-o.debug."
|
||||
|
||||
// IsDebug checks if name is a debugging name, i.e. starts with o-o.debug.
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/miekg/dns"
|
||||
)
|
||||
|
||||
// PorseHostPortOrFile parses the strings in s, each string can either be a address,
|
||||
// ParseHostPortOrFile parses the strings in s, each string can either be a address,
|
||||
// address:port or a filename. The address part is checked and the filename case a
|
||||
// resolv.conf like file is parsed and the nameserver found are returned.
|
||||
func ParseHostPortOrFile(s ...string) ([]string, error) {
|
||||
|
||||
Reference in New Issue
Block a user