mirror of
https://github.com/coredns/coredns.git
synced 2025-12-02 16:44:01 -05:00
Cleanups and tests (#272)
For some reasons there was a dnsserver/middleware.go that defined the middleware handlers. This code was a repeat from middleware/middleware.go. Removed dnsserver/middleware.go and replaced all uses of dnsserver.Middleware with middleware.Middleware. Added dnsserver/address_test.go to test the zone normalization (and to improve the test coverage). The deleted file will also improve the test coverage :)
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
package dnsserver
|
||||
|
||||
import "github.com/mholt/caddy"
|
||||
import (
|
||||
"github.com/miekg/coredns/middleware"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
)
|
||||
|
||||
// Config configuration for a single server.
|
||||
type Config struct {
|
||||
@@ -13,14 +17,11 @@ type Config struct {
|
||||
// The port to listen on.
|
||||
Port string
|
||||
|
||||
// The directory from which to parse db files, and store keys.
|
||||
Root string
|
||||
|
||||
// Middleware stack.
|
||||
Middleware []Middleware
|
||||
Middleware []middleware.Middleware
|
||||
|
||||
// Compiled middleware stack.
|
||||
middlewareChain Handler
|
||||
middlewareChain middleware.Handler
|
||||
}
|
||||
|
||||
// GetConfig gets the Config that corresponds to c.
|
||||
@@ -33,6 +34,6 @@ func GetConfig(c *caddy.Controller) *Config {
|
||||
// we should only get here during tests because directive
|
||||
// actions typically skip the server blocks where we make
|
||||
// the configs.
|
||||
ctx.saveConfig(c.Key, &Config{Root: Root})
|
||||
ctx.saveConfig(c.Key, &Config{})
|
||||
return GetConfig(c)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user