@cryptotaxi247 / kubo / commits / 0b73a48b8

commands/http: Made Handler set request contexts

Matt Bell committed Oct 27, 2014 at 18:14 UTC 0b73a48b843cbed89b5081f2e564d7f67daaeb80
1 file changed +3 -1
cmd/ipfs/daemon.go
+3 -1
@@ -20,6 +20,8 @@ var Daemon = &cmds.Command{
20 }
21
22 func daemonFunc(req cmds.Request, res cmds.Response) {
23 + // TODO: spin up a core.IpfsNode
24 +
25 ctx := req.Context()
26
27 lk, err := daemon.Lock(ctx.ConfigRoot)
@@ -41,7 +43,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
43 return
44 }
45
44 - handler := cmdsHttp.Handler{}
46 + handler := cmdsHttp.Handler{*ctx}
47 http.Handle(cmdsHttp.ApiPath+"/", handler)
48 err = http.ListenAndServe(host, nil)
49 if err != nil {