Commit 36c743a4 authored by Miek Gieben's avatar Miek Gieben Committed by GitHub

middleware/etc: normalize the zone correctly (#597)

Also don't default to a default proxy; keep it empty.
Normalize the zones, so that is the server block ones are used, it will
actually work.
parent 5ac6020f
...@@ -49,7 +49,8 @@ func setup(c *caddy.Controller) error { ...@@ -49,7 +49,8 @@ func setup(c *caddy.Controller) error {
func etcdParse(c *caddy.Controller) (*Etcd, bool, error) { func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
stub := make(map[string]proxy.Proxy) stub := make(map[string]proxy.Proxy)
etc := Etcd{ etc := Etcd{
Proxy: proxy.NewLookup([]string{"8.8.8.8:53", "8.8.4.4:53"}), // Don't default to a proxy for lookups.
// Proxy: proxy.NewLookup([]string{"8.8.8.8:53", "8.8.4.4:53"}),
PathPrefix: "skydns", PathPrefix: "skydns",
Ctx: context.Background(), Ctx: context.Background(),
Inflight: &singleflight.Group{}, Inflight: &singleflight.Group{},
...@@ -68,7 +69,10 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) { ...@@ -68,7 +69,10 @@ func etcdParse(c *caddy.Controller) (*Etcd, bool, error) {
etc.Zones = make([]string, len(c.ServerBlockKeys)) etc.Zones = make([]string, len(c.ServerBlockKeys))
copy(etc.Zones, c.ServerBlockKeys) copy(etc.Zones, c.ServerBlockKeys)
} }
middleware.Zones(etc.Zones).Normalize() for i, str := range etc.Zones {
etc.Zones[i] = middleware.Host(str).Normalize()
}
if c.NextBlock() { if c.NextBlock() {
// TODO(miek): 2 switches? // TODO(miek): 2 switches?
switch c.Val() { switch c.Val() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment