Compare commits
2 Commits
4606f852cc
...
723c1a83a0
Author | SHA1 | Date | |
---|---|---|---|
723c1a83a0 | |||
ebd9bd75a5 |
@ -51,7 +51,11 @@ class DNSManager::Client < IPC
|
||||
def user_domain_add(domain : String)
|
||||
request = Request::NewDomain.new domain
|
||||
send_now request
|
||||
parse_message [ Response::Success ], read
|
||||
parse_message [ Response::DomainAdded,
|
||||
Response::DomainAlreadyExists,
|
||||
Response::InvalidDomainName,
|
||||
Response::UnacceptableDomain
|
||||
], read
|
||||
end
|
||||
|
||||
# Remove a domain.
|
||||
|
@ -133,6 +133,8 @@ class DNSManager::Storage
|
||||
end
|
||||
|
||||
matching_domains.each do |md|
|
||||
# Prevent empty domains (from crafted requests) to be accepted.
|
||||
return Response::InvalidDomainName.new unless (domain.chomp md).size > 2
|
||||
Baguette::Log.info "Add new domain #{domain} (matching domain #{md})"
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user