diff --git a/website/api/controllers/docs/view-basic-documentation.js b/website/api/controllers/docs/view-basic-documentation.js index a6a64ae0a4..487bc70c14 100644 --- a/website/api/controllers/docs/view-basic-documentation.js +++ b/website/api/controllers/docs/view-basic-documentation.js @@ -55,6 +55,12 @@ module.exports = { } } + let showSwagForm = false; + // Due to shipping costs, we'll check the requesting user's cf-ipcountry to see if they're in the US, and their cf-iplongitude header to see if they're in the contiguous US. + if(this.req.get('cf-ipcountry') === 'US' && this.req.get('cf-iplongitude') > -125) { + showSwagForm = true; + } + // Respond with view. return { path: require('path'), @@ -69,6 +75,7 @@ module.exports = { thisPage.meta.description ? thisPage.meta.description // « custom meta description for this page, if provided in markdown : 'Documentation for Fleet for osquery.'// « otherwise use the generic description ), + showSwagForm }; } diff --git a/website/views/pages/docs/basic-documentation.ejs b/website/views/pages/docs/basic-documentation.ejs index 834f75a244..ce1b3146bc 100644 --- a/website/views/pages/docs/basic-documentation.ejs +++ b/website/views/pages/docs/basic-documentation.ejs @@ -183,7 +183,7 @@ -