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

http-proxy-middleware

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-proxy-middleware - npm Package Compare versions

Comparing version 0.16.0 to 0.17.0-beta

3

CHANGELOG.md
# Changelog
## [develop](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.17.0)
- fix(wildcard context matching): Use [RFC 3986 path](https://tools.ietf.org/html/rfc3986#section-3.3) in wildcard matching. (excludes query parameters)
## [v0.16.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v0.16.0)

@@ -4,0 +7,0 @@ - deprecated(proxyTable): renamed `proxyTable` to `router`.

12

lib/context-matcher.js

@@ -36,3 +36,3 @@ var _ = require('lodash');

if (_.isFunction(context)) {
var path = getUrlPath(uri);
var path = getUrl(uri).path;
return context(path, req);

@@ -50,3 +50,3 @@ }

function matchSingleStringPath(context, uri) {
var path = getUrlPath(uri);
var path = getUrl(uri).path;
return path.indexOf(context) === 0;

@@ -56,4 +56,4 @@ }

function matchSingleGlobPath(pattern, uri) {
var path = getUrlPath(uri);
var matches = micromatch(path, pattern);
var pathname = getUrl(uri).pathname;
var matches = micromatch(pathname, pattern);
return matches && (matches.length > 0);

@@ -81,4 +81,4 @@ }

function getUrlPath(uri) {
return uri && url.parse(uri).path;
function getUrl(uri) {
return uri && url.parse(uri);
}

@@ -85,0 +85,0 @@

{
"name": "http-proxy-middleware",
"version": "0.16.0",
"version": "0.17.0-beta",
"description": "The one-liner node.js proxy middleware for connect, express and browser-sync",

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

@@ -114,5 +114,5 @@ var expect = require('chai').expect;

it('should only match .php files with query params', function() {
expect(contextMatcher.match('/**/*.php', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.false;
expect(contextMatcher.match('/**/*.php?*', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.true;
it('should ignore query params', function() {
expect(contextMatcher.match('/**/*.php', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.true;
expect(contextMatcher.match('/**/*.php?*', 'http://localhost/a/b/c.php?d=e&e=f')).to.be.false;
});

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