SetIdentity stamps the request with User-Agent, X-Docker-Agent-Version, and (when Docker Desktop is reachable) X-Docker-Desktop-Version. Callers that want operator-supplied overrides should apply those headers AFTER calling SetIdentity.
(req *http.Request)
| 27 | // that want operator-supplied overrides should apply those headers AFTER |
| 28 | // calling SetIdentity. |
| 29 | func SetIdentity(req *http.Request) { |
| 30 | req.Header.Set("User-Agent", Header) |
| 31 | req.Header.Set(HeaderAgentVersion, version.Version) |
| 32 | if v := desktop.GetVersion(req.Context()); v != "" { |
| 33 | req.Header.Set(HeaderDesktopVersion, v) |
| 34 | } |
| 35 | } |