Socket
Socket
Sign inDemoInstall

express-request-id

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

5

index.js

@@ -10,7 +10,8 @@ 'use strict';

options.headerName = options.headerName || 'X-Request-Id';
options.attributeName = options.attributeName || 'id';
return function (req, res, next) {
req.id = req.header(options.headerName) || uuid[options.uuidVersion](options, options.buffer, options.offset);
req[options.attributeName] = req.header(options.headerName) || uuid[options.uuidVersion](options, options.buffer, options.offset);
if (options.setHeader) {
res.setHeader(options.headerName, req.id);
res.setHeader(options.headerName, req[options.attributeName]);
}

@@ -17,0 +18,0 @@ next();

2

package.json
{
"name": "express-request-id",
"version": "1.3.0",
"version": "1.4.0",
"description": "Generate UUID for request and add it to headers",

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

@@ -36,2 +36,3 @@ # express-request-id [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]

* `headerName` - string, indicates the header name to use (defaults to `X-Request-Id`).
* `attributeName` - string, indicates the attribute name used for the identifier on the request object (defaults to `id`)

@@ -38,0 +39,0 @@ This options fields are passed to node-uuid functions directly:

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc