From 9d32f71e22299604ba7748549eaad4e667198712 Mon Sep 17 00:00:00 2001 From: Adin Schmahmann Date: Thu, 31 Aug 2023 03:49:35 -0400 Subject: [PATCH] move the gateway-over-libp2p mountpoint to the root --- cmd/ipfs/daemon.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index ed8040c01..b28b59764 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -929,7 +929,13 @@ func serveTrustlessGatewayOverLibp2p(cctx *oldcmds.Context) (<-chan error, error StreamHost: node.PeerHost, } - h.SetHTTPHandler(gatewayProtocolID, handler) + tmpProtocol := protocol.ID("/kubo/delete-me") + h.SetHTTPHandler(tmpProtocol, http.NotFoundHandler()) + h.WellKnownHandler.RemoveProtocolMeta(tmpProtocol) + + h.WellKnownHandler.AddProtocolMeta(gatewayProtocolID, p2phttp.ProtocolMeta{Path: "/"}) + h.ServeMux = http.NewServeMux() + h.ServeMux.Handle("/", handler) errc := make(chan error, 1) go func() {