diff --git a/README.md b/README.md index cb63274e8fcfb154d7861fed4f485dc54e4ab86d..48110e0022726a3d393f85e5fd4ee2e360350037 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > the oldest IPFS implementation, previously known as "go-ipfs" - + [](https://protocol.ai) [](https://godoc.org/github.com/ipfs/kubo) diff --git a/core/corehttp/commands.go b/core/corehttp/commands.go index b433dfea7d7cb4a4cc546423c73a168fcc03e1f9..c0ebf550616362546648e2747ae1fc641423ec0c 100644 --- a/core/corehttp/commands.go +++ b/core/corehttp/commands.go @@ -85,7 +85,7 @@ func addHeadersFromConfig(c *cmdsHttp.ServerConfig, nc *config.Config) { c.Headers[h] = v } } - c.Headers["Server"] = []string{"go-ipfs/" + version.CurrentVersionNumber} + c.Headers["Server"] = []string{"kubo/" + version.CurrentVersionNumber} } func addCORSDefaults(c *cmdsHttp.ServerConfig) { @@ -163,7 +163,7 @@ func CommandsROOption(cctx oldcmds.Context) ServeOption { return commandsOption(cctx, corecommands.RootRO, true) } -// CheckVersionOption returns a ServeOption that checks whether the client ipfs version matches. Does nothing when the user agent string does not contain `/go-ipfs/` +// CheckVersionOption returns a ServeOption that checks whether the client ipfs version matches. Does nothing when the user agent string does not contain `/kubo/` or `/go-ipfs/` func CheckVersionOption() ServeOption { daemonVersion := version.ApiVersion @@ -177,8 +177,8 @@ func CheckVersionOption() ServeOption { // backwards compatibility to previous version check if len(pth) >= 2 && pth[1] != "version" { clientVersion := r.UserAgent() - // skips check if client is not go-ipfs - if strings.Contains(clientVersion, "/go-ipfs/") && daemonVersion != clientVersion { + // skips check if client is not kubo (go-ipfs) + if (strings.Contains(clientVersion, "/go-ipfs/") || strings.Contains(clientVersion, "/kubo/")) && daemonVersion != clientVersion { http.Error(w, fmt.Sprintf("%s (%s != %s)", errAPIVersionMismatch, daemonVersion, clientVersion), http.StatusBadRequest) return }