提交 78c43fe6 作者: Dr Ian Preston 提交者: Steven Allen

move p2p http proxy from api to gateway

License: MIT
Signed-off-by: 's avatarIan Preston <ianopolous@protonmail.com>
上级 28652758
......@@ -290,9 +290,9 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
// Start assembling node config
ncfg := &core.BuildCfg{
Repo: repo,
Permanent: true, // It is temporary way to signify that node is permanent
Online: !offline,
Repo: repo,
Permanent: true, // It is temporary way to signify that node is permanent
Online: !offline,
DisableEncryptedConnections: unencrypted,
ExtraOpts: map[string]bool{
"pubsub": pubsub,
......@@ -467,9 +467,6 @@ func serveHTTPApi(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, error
opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect))
}
if cfg.Experimental.P2pHttpProxy {
opts = append(opts, corehttp.ProxyOption())
}
node, err := cctx.ConstructNode()
if err != nil {
return nil, fmt.Errorf("serveHTTPApi: ConstructNode() failed: %s", err)
......@@ -573,6 +570,10 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e
corehttp.CommandsROOption(*cctx),
}
if cfg.Experimental.P2pHttpProxy {
opts = append(opts, corehttp.ProxyOption())
}
if len(cfg.Gateway.RootRedirect) > 0 {
opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect))
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论