diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 329a29c4cf4..e3a2fef7d62 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -319,9 +319,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, @@ -677,6 +677,10 @@ func serveHTTPGateway(req *cmds.Request, cctx *oldcmds.Context) (<-chan error, e opts = append(opts, corehttp.RedirectOption("", cfg.Gateway.RootRedirect)) } + if len(cfg.Gateway.PathPrefixes) > 0 { + log.Error("Support for X-Ipfs-Gateway-Prefix and Gateway.PathPrefixes is deprecated and will be removed in the next release: https://github.com/ipfs/go-ipfs/issues/7702") + } + node, err := cctx.ConstructNode() if err != nil { return nil, fmt.Errorf("serveHTTPGateway: ConstructNode() failed: %s", err) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index e4719817418..261c2920f60 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -159,6 +159,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request // If the gateway is behind a reverse proxy and mounted at a sub-path, // the prefix header can be set to signal this sub-path. // It will be prepended to links in directory listings and the index.html redirect. + // TODO: this feature is deprecated and will be removed (https://github.com/ipfs/go-ipfs/issues/7702) prefix := "" if prfx := r.Header.Get("X-Ipfs-Gateway-Prefix"); len(prfx) > 0 { for _, p := range i.config.PathPrefixes {