@bonniernews/local-esi
Advanced tools
Comparing version 2.2.1 to 2.3.0
@@ -11,5 +11,16 @@ Changelog | ||
### Fixed | ||
- Readme parse example typo | ||
## [2.3.0] - 2022-09-03 | ||
- Add support for GEO substructures | ||
## [2.2.1] - 2022-05-17 | ||
- esi:except in esi:try should be optional | ||
## [2.2.0] - 2022-05-17 | ||
- check for esi:when and otherwise in esi:choose | ||
- add validation for esi:try | ||
- fix example typo and new eslint rules | ||
## [2.1.2] - 2022-03-03 | ||
@@ -16,0 +27,0 @@ |
@@ -22,2 +22,3 @@ "use strict"; | ||
...buildHeaderVariables(options.headers), | ||
...buildGeoSubstructures(options.headers), | ||
HTTP_COOKIE: options.cookies || {}, | ||
@@ -126,1 +127,12 @@ REQUEST_PATH: options.path || {}, | ||
} | ||
function buildGeoSubstructures(headers) { | ||
return { | ||
GEO: headers?.["x-localesi-geo"] | ||
? JSON.parse(headers["x-localesi-geo"]) | ||
: { | ||
country_code: "SE", | ||
georegion: 208, | ||
}, | ||
}; | ||
} |
{ | ||
"name": "@bonniernews/local-esi", | ||
"version": "2.2.1", | ||
"version": "2.3.0", | ||
"description": "Local Edge Side Includes parser", | ||
@@ -24,7 +24,7 @@ "main": "index.js", | ||
"chronokinesis": "^3.1.2", | ||
"eslint": "^8.11.0", | ||
"eslint": "^8.23.1", | ||
"eslint-config-exp": "^0.1.1", | ||
"got": "^11.8.3", | ||
"mocha": "^9.2.2", | ||
"nock": "^13.2.4" | ||
"got": "^11.8.5", | ||
"mocha": "^10.0.0", | ||
"nock": "^13.2.9" | ||
}, | ||
@@ -31,0 +31,0 @@ "engines": { |
@@ -21,2 +21,3 @@ Local-ESI | ||
- `headers`: request headers, accessible through ESI globals `HTTP_<HEADER_NAME>`, `x-forwarded-for` will be accessible as `REMOTE_ADDR` | ||
- `x-localesi-geo`: headers to simulate Akamai's geo location abilities. Defaults to: `country_code=SE,georegion=208`. Accessible through ESI global `GEO{}` | ||
- `cookies`: object with request cookies, accessible through ESI global `HTTP_COOKIE` | ||
@@ -23,0 +24,0 @@ - `path`: string request path, mapped to ESI global `REQUEST_PATH` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55958
1677
164