aboutsummaryrefslogtreecommitdiff
path: root/middleware/auto/auto.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/auto/auto.go')
-rw-r--r--middleware/auto/auto.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/middleware/auto/auto.go b/middleware/auto/auto.go
index 115e86dea..0557fc3d1 100644
--- a/middleware/auto/auto.go
+++ b/middleware/auto/auto.go
@@ -44,7 +44,7 @@ type (
func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
state := request.Request{W: w, Req: r}
if state.QClass() != dns.ClassINET {
- return dns.RcodeServerFailure, errors.New("can only deal with ClassINET")
+ return dns.RcodeServerFailure, middleware.Error(a.Name(), errors.New("can only deal with ClassINET"))
}
qname := state.Name()
@@ -53,10 +53,7 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
// Precheck with the origins, i.e. are we allowed to looks here.
zone := middleware.Zones(a.Zones.Origins()).Matches(qname)
if zone == "" {
- if a.Next != nil {
- return a.Next.ServeDNS(ctx, w, r)
- }
- return dns.RcodeServerFailure, errors.New("no next middleware found")
+ return middleware.NextOrFailure(a.Name(), a.Next, ctx, w, r)
}
// Now the real zone.
value='jarred/new-bund'>jarred/new-bund Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-06-22use JSValue for `bun test`Gravatar Jarred Sumner 1-13/+19