move the gateway-over-libp2p mountpoint to the root

This commit is contained in:
Adin Schmahmann 2023-08-31 03:49:35 -04:00
parent 5b0da08333
commit 9d32f71e22

View File

@ -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() {