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

@podium/context

Package Overview
Dependencies
Maintainers
4
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@podium/context - npm Package Compare versions

Comparing version 3.0.0-beta.3 to 3.0.0-beta.4

48

lib/context.js

@@ -8,3 +8,2 @@ 'use strict';

const utils = require('@podium/utils');
const boom = require('boom');
const joi = require('joi');

@@ -18,3 +17,2 @@ const PublicPathname = require('./get-public-pathname');

const Debug = require('./get-debug');
const State = require('./state');

@@ -85,2 +83,8 @@ const PREFIX = 'podium';

const timer = this.metrics.timer({
name: 'context_run_parsers',
description:
'Time taken to run all context parsers',
});
const parsers = Array.from(this.parsers);

@@ -96,2 +100,5 @@ return Promise.all(

});
timer();
return state;

@@ -101,39 +108,2 @@ });

middleware() {
return async (req, res, next) => {
const successTimer = this.metrics.timer({
name: 'context_run_parsers_success',
description:
'Time taken to successfully run all context parsers',
});
const failureTimer = this.metrics.timer({
name: 'context_run_parsers_failure',
description:
'Time taken for failure to occur when running all context parsers',
});
let state = new State(req, res, res.locals);
try {
state = await this.process(state);
successTimer();
if (state) {
utils.setAtLocalsPodium(res, 'context', state.context);
next();
}
} catch (error) {
const message = `Error during context parsing or serializing`;
failureTimer({
meta: {
message,
error: error.message,
stack: error.stack,
},
});
next(boom.badGateway(message, error));
}
};
}
static serialize(headers, context, name) {

@@ -140,0 +110,0 @@ return utils.serializeContext(headers, context, name);

@@ -41,3 +41,2 @@ 'use strict';

enumerable: true,
writable: true,
value: {},

@@ -44,0 +43,0 @@ });

3

package.json
{
"name": "@podium/context",
"version": "3.0.0-beta.3",
"version": "3.0.0-beta.4",
"description": "Module to generate the context which is passed on requests from a Layout server to a Podlet server",

@@ -37,3 +37,2 @@ "license": "MIT",

"bcp47-validate": "^1.0.0",
"boom": "^7.2.0",
"bowser": "^2.1.0",

@@ -40,0 +39,0 @@ "decamelize": "^2.0.0",

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