mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
Move api version string to repo config
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
parent
0123971118
commit
aabf80723d
@ -100,8 +100,7 @@ func (c *client) Send(req cmds.Request) (cmds.Response, error) {
|
||||
} else {
|
||||
httpReq.Header.Set(contentTypeHeader, applicationOctetStream)
|
||||
}
|
||||
version := config.CurrentVersionNumber
|
||||
httpReq.Header.Set(uaHeader, fmt.Sprintf("/go-ipfs/%s/", version))
|
||||
httpReq.Header.Set(uaHeader, config.ApiVersion)
|
||||
|
||||
ec := make(chan error, 1)
|
||||
rc := make(chan cmds.Response, 1)
|
||||
|
||||
@ -439,7 +439,7 @@ func apiVersionMatches(r *http.Request) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
daemonVersion := fmt.Sprintf("/go-ipfs/%s/", config.CurrentVersionNumber)
|
||||
daemonVersion := config.ApiVersion
|
||||
if daemonVersion != clientVersion {
|
||||
return fmt.Errorf("%s (%s != %s)", errApiVersionMismatch, daemonVersion, clientVersion)
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ import (
|
||||
// CurrentVersionNumber is the current application's version literal
|
||||
const CurrentVersionNumber = "0.3.11-dev"
|
||||
|
||||
const ApiVersion = "/go-ipfs/" + CurrentVersionNumber + "/"
|
||||
|
||||
// CurrentCommit is the current git commit, this is set as a ldflag in the Makefile
|
||||
var CurrentCommit string
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user