Skip to content

Commit

Permalink
improvement: added more headers to checkForUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
10ko committed Sep 9, 2019
1 parent e2ade31 commit c7e0afb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion garden-service/src/cli/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ export async function checkForUpdates(config: GlobalConfigStore, logger: LogEntr
platformVersion: release(),
}
try {
const res = await axios.get(`${VERSION_CHECK_URL}?${qs.stringify(query)}`)
const globalConfig = await config.get()
const headers = {}
headers["X-user-id"] = globalConfig.analytics ? globalConfig.analytics.userId : "unknown"

const res = await axios.get(`${VERSION_CHECK_URL}?${qs.stringify(query)}`, { headers })
const configObj = await config.get()
const showMessage = (configObj.lastVersionCheck
&& moment().subtract(1, "days").isAfter(moment(configObj.lastVersionCheck.lastRun)))
Expand Down

0 comments on commit c7e0afb

Please sign in to comment.