@cryptotaxi247 / kubo / commits / 27b43612b

fix refs handling on gateway

License: MIT Signed-off-by: keks <keks@cryptoscope.co>

keks committed Dec 20, 2017 at 11:10 UTC 27b43612b6f16cad5bab0a6ed4fa0f9b5f037832
2 files changed +5 -2
cmd/ipfs/daemon.go
-1
@@ -435,7 +435,6 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (error, <-chan error
435 corehttp.MetricsCollectionOption("api"),
436 corehttp.CheckVersionOption(),
437 corehttp.CommandsOption(*cctx),
438 - //corehttp.ServerNameOption("go-ipfs/" + config.CurrentVersionNumber),
438 corehttp.WebUIOption,
439 gatewayOpt,
440 corehttp.VersionOption(),
core/commands/root.go
+5 -1
@@ -179,7 +179,6 @@ var rootROSubcommands = map[string]*cmds.Command{
179 "resolve": dag.DagResolveCmd,
180 },
181 }),
182 - "refs": lgc.NewCommand(RefsROCmd),
182 "resolve": lgc.NewCommand(ResolveCmd),
183 "version": lgc.NewCommand(VersionCmd),
184 }
@@ -192,6 +191,11 @@ func init() {
191 *RefsROCmd = *RefsCmd
192 RefsROCmd.Subcommands = map[string]*oldcmds.Command{}
193
194 + // this was in the big map definition above before,
195 + // but if we leave it there lgc.NewCommand will be executed
196 + // before the value is updated (:/sanitize readonly refs command/)
197 + rootROSubcommands["refs"] = lgc.NewCommand(RefsROCmd)
198 +
199 Root.Subcommands = rootSubcommands
200
201 RootRO.Subcommands = rootROSubcommands