Socket
Socket
Sign inDemoInstall

connect-history-api-fallback

Package Overview
Dependencies
0
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.4.0 to 1.5.0

3

CHANGELOG.md
# Changelog
## v1.5.0
- Expose the HTTP request object in rewrite rules. Contributed by @VladShcherbin.
## v1.4.0

@@ -4,0 +7,0 @@ - The `.` (DOT) rule should only check the last path element. Contributed by @ntkme.

7

lib/index.js

@@ -52,3 +52,3 @@ 'use strict';

if (match !== null) {
rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to);
rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to, req);
logger('Rewriting', req.method, req.url, 'to', rewriteTarget);

@@ -79,3 +79,3 @@ req.url = rewriteTarget;

function evaluateRewriteRule(parsedUrl, match, rule) {
function evaluateRewriteRule(parsedUrl, match, rule, req) {
if (typeof rule === 'string') {

@@ -89,3 +89,4 @@ return rule;

parsedUrl: parsedUrl,
match: match
match: match,
request: req
});

@@ -92,0 +93,0 @@ }

{
"name": "connect-history-api-fallback",
"version": "1.4.0",
"version": "1.5.0",
"description": "Provides a fallback for non-existing directories so that the HTML 5 history API can be used.",

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

@@ -126,2 +126,3 @@ <h1 align="center">connect-history-api-fallback</h1>

- **match**: An Array of matched results as provided by `String.match(...)`.
- **request**: The HTTP request object.

@@ -128,0 +129,0 @@

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