Check weaveDNS subdomain on REST PUT

This commit is contained in:
Adam Harrison committed 2015-10-27 14:37:57 +00:00
1 parent 94d7f33a03
commit 7408f72de2
1 file changed
+5
+5
View File
@@ -35,6 +35,11 @@ func (n *Nameserver) HandleHTTP(router *mux.Router, dockerCli *docker.Client) {
return
}
if !dns.IsSubDomain(n.domain, hostname) {
n.infof("Ignoring registration %s %s %s (not a subdomain of %s)", hostname, ipStr, container, n.domain)
return
}
if err := n.AddEntry(hostname, container, n.ourName, ip); err != nil {
n.badRequest(w, fmt.Errorf("Unable to add entry: %v", err))
return