aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-04-01 16:51:56 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-04-01 16:51:56 +0200
commita92efb481fde20bdd25e9133f7f130fa85231aff (patch)
tree90ba2a852e6581cf73e1ede46f654e05c2357788
parent7396bdc3b4745108760282890d0ae1c985865d69 (diff)
Update rpc.Del
-rw-r--r--rpc.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpc.go b/rpc.go
index 0916e88..71ef552 100644
--- a/rpc.go
+++ b/rpc.go
@@ -12,7 +12,7 @@ var (
ErrNoCert = errors.New("Certificate and Key are required")
)
-const PRCPort = ":8000"
+const RPCPort = ":8000"
type GoXY struct {
server *Server
@@ -67,7 +67,11 @@ func (s *GoXY) Add(e Entry, _ *struct{}) error {
// Del removes a route
func (s *GoXY) Del(host string, _ *struct{}) error {
- delete(s.server.Route, host)
+ h, err := url.Parse(host)
+ if err != nil {
+ return err
+ }
+ delete(s.server.Route, h.Host)
s.server.Save(s.server.DataFile)
return s.server.Update()
}