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.2.0 to 1.3.0

5

index.js

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

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

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

2

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

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

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

* `setHeader` - boolean, indicates that header should be added to response (defaults to `true`).
* `headerName` - string, indicates the header name to use (defaults to `X-Request-Id`).

@@ -37,0 +38,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