Commit 1d01c035 authored by Brian Tiger Chow's avatar Brian Tiger Chow

refactor(cmd/daemon) more compact representation!

exposed the Decider to make configuration nicer @mappum
parent db644fe1
......@@ -193,19 +193,19 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}()
}
blocklist := &corehttp.BlockList{}
blocklist.SetDecider(func(s string) bool {
// for now, only allow paths in the WebUI path
for _, webuipath := range corehttp.WebUIPaths {
if strings.HasPrefix(s, webuipath) {
return true
}
}
return false
})
gateway := corehttp.NewGateway(corehttp.GatewayConfig{
Writable: true,
BlockList: blocklist,
Writable: true,
BlockList: &corehttp.BlockList{
Decider: func(s string) bool {
// for now, only allow paths in the WebUI path
for _, webuipath := range corehttp.WebUIPaths {
if strings.HasPrefix(s, webuipath) {
return true
}
}
return false
},
},
})
var opts = []corehttp.ServeOption{
corehttp.CommandsOption(*req.Context()),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment