express-prom-bundle
Advanced tools
Comparing version 1.2.0 to 1.2.1
{ | ||
"name": "express-prom-bundle", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "express middleware with popular prometheus metrics in one bundle", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -119,3 +119,3 @@ [![build status](https://travis-ci.org/jochen-schweizer/express-prom-bundle.png)](https://travis-ci.org/jochen-schweizer/express-prom-bundle) [![Coverage Status](https://coveralls.io/repos/github/jochen-schweizer/express-prom-bundle/badge.svg?branch=master)](https://coveralls.io/github/jochen-schweizer/express-prom-bundle?branch=master) [![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://www.tldrlegal.com/l/mit) [![NPM version](https://badge.fury.io/js/express-prom-bundle.png)](http://badge.fury.io/js/express-prom-bundle) | ||
* **1.2.0** | ||
* **1.2.1** | ||
* upgrade prom-client to 6.1.2 | ||
@@ -122,0 +122,0 @@ * add options: includeMethod, includePath, keepDefaultMetrics |
"use strict"; | ||
const UrlValueParser = require("url-value-parser"); | ||
const url = require("url"); | ||
let urlValueParser; | ||
@@ -8,4 +9,10 @@ | ||
opts = opts || {}; | ||
// originalUrl is taken, because url and path can be changed | ||
// by middlewares such as "router". Note: this function is called onFinish | ||
/// i.e. always in the tail of the middleware chain | ||
const path = url.parse(req.originalUrl).pathname; | ||
if (opts.normalizePath !== undefined && !opts.normalizePath) { | ||
return req.path; | ||
return path; | ||
} | ||
@@ -15,6 +22,7 @@ if (typeof opts.normalizePath === "function") { | ||
} | ||
if (!urlValueParser) { | ||
urlValueParser = new UrlValueParser(); | ||
} | ||
return urlValueParser.replacePathValues(req.path); | ||
return urlValueParser.replacePathValues(path); | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14048
191