Merge pull request #1597 from weaveworks/issues/1516-weavedns-ignore-foreign-domains

Check weaveDNS subdomain on REST PUT

Fixes #1516
This commit is contained in:
Matthias Radestock committed 2015-10-28 08:50:25 +00:00
commit b697b6e57b
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