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

nodesi

Package Overview
Dependencies
Maintainers
3
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodesi - npm Package Compare versions

Comparing version 1.9.0 to 1.9.1

7

lib/data-provider.js

@@ -19,3 +19,3 @@ 'use strict';

return {
url: toFullyQualifiedURL(src),
url: toFullyQualifiedURL(src, baseOptions),
headers: Object.assign({}, defaultHeaders, baseOptions.headers)

@@ -25,7 +25,8 @@ };

function toFullyQualifiedURL(urlOrPath) {
function toFullyQualifiedURL(urlOrPath, baseOptions) {
if(urlOrPath.indexOf('http') === 0) {
return urlOrPath;
} else {
return url.resolve(baseUrl, urlOrPath);
const base = baseOptions ? baseOptions.baseUrl || baseUrl : baseUrl;
return url.resolve(base, urlOrPath);
}

@@ -32,0 +33,0 @@ }

@@ -115,3 +115,3 @@ 'use strict';

function get(src, options) {
src = dataProvider.toFullyQualifiedURL(src);
src = dataProvider.toFullyQualifiedURL(src, options);

@@ -118,0 +118,0 @@ return Promise.resolve()

{
"name": "nodesi",
"version": "1.9.0",
"version": "1.9.1",
"description": "ESI: the good parts in node.js",

@@ -5,0 +5,0 @@ "main": "esi.js",

@@ -80,2 +80,15 @@ [![Build Status](https://travis-ci.org/Schibsted-Tech-Polska/nodesi.svg?branch=master)](https://travis-ci.org/Schibsted-Tech-Polska/nodesi)

If you'd like to adjust the baseUrl dynamically, use `req.esiOptions` object:
```javascript
...
app.use(esiMiddleware());
app.get('/example', function(req, res) {
req.esiOptions = {
baseUrl: req.url
};
res.render('example');
});
```
#### With base URL for relative paths:

@@ -82,0 +95,0 @@ ```javascript

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