netlify-cli 12.0.0 → 12.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "12.0.0",
3
+ "version": "12.0.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "12.0.0",
9
+ "version": "12.0.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "12.0.0",
4
+ "version": "12.0.1",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -4,6 +4,7 @@ const os = require('os')
4
4
  const process = require('process')
5
5
  const { format, inspect } = require('util')
6
6
 
7
+ // eslint-disable-next-line no-restricted-modules
7
8
  const { Instance: ChalkInstance } = require('chalk')
8
9
  const chokidar = require('chokidar')
9
10
  const decache = require('decache')
@@ -510,6 +510,7 @@ const startProxy = async function ({
510
510
  jwtSecret: settings.jwtSecret,
511
511
  jwtRoleClaim: settings.jwtRolePath,
512
512
  configPath,
513
+ geoCountry,
513
514
  })
514
515
 
515
516
  const onRequestWithOptions = onRequest.bind(undefined, {
@@ -33,11 +33,7 @@ const getLanguage = function (headers) {
33
33
  return 'en'
34
34
  }
35
35
 
36
- const getCountry = function () {
37
- return 'us'
38
- }
39
-
40
- const createRewriter = async function ({ configPath, distDir, jwtRoleClaim, jwtSecret, projectDir }) {
36
+ const createRewriter = async function ({ configPath, distDir, geoCountry, jwtRoleClaim, jwtSecret, projectDir }) {
41
37
  let matcher = null
42
38
  const redirectsFiles = [...new Set([path.resolve(distDir, '_redirects'), path.resolve(projectDir, '_redirects')])]
43
39
  let redirects = await parseRedirects({ redirectsFiles, configPath })
@@ -80,7 +76,7 @@ const createRewriter = async function ({ configPath, distDir, jwtRoleClaim, jwtS
80
76
  const cookieValues = cookie.parse(req.headers.cookie || '')
81
77
  const headers = {
82
78
  'x-language': cookieValues.nf_lang || getLanguage(req.headers),
83
- 'x-country': cookieValues.nf_country || getCountry(),
79
+ 'x-country': cookieValues.nf_country || geoCountry || 'us',
84
80
  ...req.headers,
85
81
  }
86
82