connect-history-api-fallback
Advanced tools
Comparing version 1.4.0 to 1.5.0
# 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. |
@@ -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 @@ |
11141
99
165