Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1597 from /issues/1516-weavedns-ignore-foreign-do…
Browse files Browse the repository at this point in the history
…mains

Check weaveDNS subdomain on REST PUT

Fixes #1516
  • Loading branch information
rade committed Oct 28, 2015
2 parents 94d7f33 + 7408f72 commit b697b6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nameserver/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b697b6e

Please sign in to comment.