generate host if none exists
This commit is contained in:
parent
d7461cfbf5
commit
9342891f14
|
@ -1,6 +1,7 @@
|
||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"git.xeserv.us/xena/route/lib/elfs"
|
||||||
proto "git.xeserv.us/xena/route/proto"
|
proto "git.xeserv.us/xena/route/proto"
|
||||||
"github.com/Xe/ln"
|
"github.com/Xe/ln"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
|
@ -69,6 +70,10 @@ func (r *Route) Put(ctx context.Context, rt *proto.Route) (*proto.IDResponse, er
|
||||||
return nil, handleError(ctx, clitok, err, ln.F{"action": "Route.Put_getAuth"})
|
return nil, handleError(ctx, clitok, err, ln.F{"action": "Route.Put_getAuth"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rt.Host == "" {
|
||||||
|
rt.Host = elfs.MakeName() + r.cfg.DomainSuffix
|
||||||
|
}
|
||||||
|
|
||||||
drt, err := r.db.PutRoute(ctx, rt.Host, clitok.Owner)
|
drt, err := r.db.PutRoute(ctx, rt.Host, clitok.Owner)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ln.Error(err, ln.F{"action": "Route.Put"})
|
ln.Error(err, ln.F{"action": "Route.Put"})
|
||||||
|
|
Loading…
Reference in New Issue