aboutsummaryrefslogtreecommitdiff
path: root/rpc.go
diff options
context:
space:
mode:
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()