Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bonniernews/local-esi

Package Overview
Dependencies
Maintainers
15
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bonniernews/local-esi - npm Package Compare versions

Comparing version 2.2.1 to 2.3.0

15

CHANGELOG.md

@@ -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,
},
};
}

10

package.json
{
"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`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc