1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-26 04:26:07 +08:00

feat: path consolidation (#10063)

This commit is contained in:
Henrique Dias
2023-10-06 16:14:44 +02:00
committed by GitHub
parent ecda7ae2f5
commit a7c6518497
70 changed files with 608 additions and 381 deletions

View File

@ -9,7 +9,6 @@ import (
"strconv"
"strings"
path "github.com/ipfs/boxo/path"
cmds "github.com/ipfs/go-ipfs-cmds"
cmdsHttp "github.com/ipfs/go-ipfs-cmds/http"
version "github.com/ipfs/kubo"
@ -171,7 +170,7 @@ func CheckVersionOption() ServeOption {
parent.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if strings.HasPrefix(r.URL.Path, APIPath) {
cmdqry := r.URL.Path[len(APIPath):]
pth := path.SplitList(cmdqry)
pth := strings.Split(cmdqry, "/")
// backwards compatibility to previous version check
if len(pth) >= 2 && pth[1] != "version" {