Skip to content

Commit

Permalink
legacy rpc: handle /api/v0/name/resolve/
Browse files Browse the repository at this point in the history
  • Loading branch information
ns4plabs committed Jan 25, 2024
1 parent 5067f27 commit 7ae71af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func TestRPCRedirectsToKubo(t *testing.T) {

tests := []rpcRedirectTest{
{"/api/v0/name/resolve?arg=some-arg", "http://example.com/api/v0/name/resolve?arg=some-arg", http.StatusTemporaryRedirect},
{"/api/v0/name/resolve/ipfs.io?arg=some-arg", "http://example.com/api/v0/name/resolve/ipfs.io?arg=some-arg", http.StatusTemporaryRedirect},
{"/api/v0/resolve?arg=some-arg", "http://example.com/api/v0/resolve?arg=some-arg", http.StatusTemporaryRedirect},
{"/api/v0/dag/resolve?arg=some-arg", "http://example.com/api/v0/dag/resolve?arg=some-arg", http.StatusTemporaryRedirect},
{"/api/v0/dns?arg=some-arg", "http://example.com/api/v0/dns?arg=some-arg", http.StatusTemporaryRedirect},
Expand Down
1 change: 1 addition & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func newKuboRPCHandler(endpoints []string) http.Handler {
}

mux.HandleFunc("/api/v0/name/resolve", redirectToKubo)
mux.HandleFunc("/api/v0/name/resolve/", redirectToKubo)
mux.HandleFunc("/api/v0/resolve", redirectToKubo)
mux.HandleFunc("/api/v0/dag/resolve", redirectToKubo)
mux.HandleFunc("/api/v0/dns", redirectToKubo)
Expand Down

0 comments on commit 7ae71af

Please sign in to comment.