move the gateway-over-libp2p mountpoint to the root
Adin Schmahmann committed
Aug 31, 2023 at 03:49 UTC
9d32f71e22299604ba7748549eaad4e667198712
1 file changed
+7
-1
cmd/ipfs/daemon.go
+7
-1
@@ -929,7 +929,13 @@ func serveTrustlessGatewayOverLibp2p(cctx *oldcmds.Context) (<-chan error, error
929
StreamHost: node.PeerHost,
930
}
931
932
- h.SetHTTPHandler(gatewayProtocolID, handler)
932
+ tmpProtocol := protocol.ID("/kubo/delete-me")
933
+ h.SetHTTPHandler(tmpProtocol, http.NotFoundHandler())
934
+ h.WellKnownHandler.RemoveProtocolMeta(tmpProtocol)
935
+
936
+ h.WellKnownHandler.AddProtocolMeta(gatewayProtocolID, p2phttp.ProtocolMeta{Path: "/"})
937
+ h.ServeMux = http.NewServeMux()
938
+ h.ServeMux.Handle("/", handler)
939
940
errc := make(chan error, 1)
941
go func() {