New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@openreply/emw-request-id

Package Overview
Dependencies
Maintainers
10
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@openreply/emw-request-id - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

docs/@openreply/emw-request-id/1.0.1/fonts/OpenSans-Bold-webfont.eot

6

API.md
## requestId([options])
## requestId(options)
searches for a trace id in the request headers or otherwise creates one

@@ -12,5 +12,5 @@

| --- | --- | --- |
| [options] | RequestIdOptions | configuration options for this middleware |
| options | RequestIdConfiguration | configuration options for this middleware |
## RequestIdOptions : object
## RequestIdConfiguration : object
**Kind**: global typedef

@@ -17,0 +17,0 @@ **Properties**

@@ -13,3 +13,3 @@ /**

/**
* @typedef RequestIdOptions
* @typedef RequestIdConfiguration
* @type {object}

@@ -29,3 +29,3 @@ * @property {string} serviceName - name of the service that will be appended to the trace id string

*
* @param {RequestIdOptions} [options] - configuration options for this middleware
* @param {RequestIdConfiguration} options - configuration options for this middleware
*/

@@ -47,4 +47,9 @@ function requestId(options) {

// overwrite default values (if any)
// eslint-disable-next-line no-param-reassign
options = Object.assign({
const {
serviceName,
traceHeader,
requestIdHeader,
setResponseHeader,
uuidGenerator
} = Object.assign({
traceHeader: 'X-Amzn-Trace-Id',

@@ -56,12 +61,5 @@ requestIdHeader: 'x-amzn-RequestId',

const {
serviceName,
traceHeader,
requestIdHeader,
setResponseHeader,
uuidGenerator
} = options;
// @param {object} req the express request object (see http://expressjs.com/en/4x/api.html#req)
// @param {object} res the express response object (see http://expressjs.com/en/4x/api.html#res)
// @param {object} next the next middleware object to be executed from the express stack
// @param {object} req the express request object (see http://expressjs.com/en/4x/api.html#req)
// @param {object} res the express response object (see http://expressjs.com/en/4x/api.html#res)
// @param {object} next the next middleware object to be executed from the express stack
return (req, res, next) => {

@@ -68,0 +66,0 @@ // explicitly set the request id

{
"name": "@openreply/emw-request-id",
"version": "1.0.0",
"version": "1.0.1",
"description": "express middleware that manages request and trace ids",

@@ -5,0 +5,0 @@ "keywords": [

@@ -5,3 +5,3 @@ /* eslint-disable import/no-extraneous-dependencies, import/no-unresolved */

/* eslint-enable import/no-extraneous-dependencies, import/no-unresolved */
const requestId = require('../lib');
const requestId = require('..');

@@ -8,0 +8,0 @@ const app = express();

const { expect } = require('chai');
const sinon = require('sinon');
const requestId = require('../lib');
const requestId = require('..');

@@ -5,0 +5,0 @@ describe('emw-request-id', () => {

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