提交 27b43612 作者: keks 提交者: Jeromy

fix refs handling on gateway

License: MIT
Signed-off-by: 's avatarkeks <keks@cryptoscope.co>
上级 4b9c36b0
......@@ -435,7 +435,6 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (error, <-chan error
corehttp.MetricsCollectionOption("api"),
corehttp.CheckVersionOption(),
corehttp.CommandsOption(*cctx),
//corehttp.ServerNameOption("go-ipfs/" + config.CurrentVersionNumber),
corehttp.WebUIOption,
gatewayOpt,
corehttp.VersionOption(),
......
......@@ -179,7 +179,6 @@ var rootROSubcommands = map[string]*cmds.Command{
"resolve": dag.DagResolveCmd,
},
}),
"refs": lgc.NewCommand(RefsROCmd),
"resolve": lgc.NewCommand(ResolveCmd),
"version": lgc.NewCommand(VersionCmd),
}
......@@ -192,6 +191,11 @@ func init() {
*RefsROCmd = *RefsCmd
RefsROCmd.Subcommands = map[string]*oldcmds.Command{}
// this was in the big map definition above before,
// but if we leave it there lgc.NewCommand will be executed
// before the value is updated (:/sanitize readonly refs command/)
rootROSubcommands["refs"] = lgc.NewCommand(RefsROCmd)
Root.Subcommands = rootSubcommands
RootRO.Subcommands = rootROSubcommands
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论