aboutsummaryrefslogtreecommitdiff
path: root/rpc.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-01 18:36:24 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-01 18:36:24 +0200
commitb7bd7e507cdbc95539ab2912a316a406111bafa0 (patch)
tree3d647b8ed28deada4f8e353fa20b5fafc3df9d9b /rpc.go
parente9069513b1287b6e3654e4d2c43b8a6a8fa1a539 (diff)
Change testing port range
Diffstat (limited to 'rpc.go')
-rw-r--r--rpc.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpc.go b/rpc.go
index a658801..bf34484 100644
--- a/rpc.go
+++ b/rpc.go
@@ -9,8 +9,9 @@ import (
)
var (
- ErrNoHost = errors.New("Both Host and Upstream are required")
- ErrNoCert = errors.New("Certificate and Key are required")
+ ErrNoHost = errors.New("Both Host and Upstream are required")
+ ErrNoCert = errors.New("Certificate and Key are required")
+ ErrEmptyHost = errors.New("Empty Host value")
)
const RPCPort = ":8000"
@@ -80,6 +81,9 @@ func (s *GoXY) Del(host string, _ *struct{}) error {
if err != nil {
return err
}
+ if h.Host == "" {
+ return ErrEmptyHost
+ }
delete(s.server.Route, h.Host)
s.server.Save(s.server.DataFile)
return s.server.Update()