nav tabs on admin dashboard
This commit is contained in:
+3
@@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## v1.6.0
|
||||
- Recommend absolute paths for rewrite targets. Contributed by @helfi92.
|
||||
|
||||
## v1.5.0
|
||||
- Expose the HTTP request object in rewrite rules. Contributed by @VladShcherbin.
|
||||
|
||||
|
||||
+12
-1
@@ -50,6 +50,17 @@ exports = module.exports = function historyApiFallback(options) {
|
||||
var match = parsedUrl.pathname.match(rewrite.from);
|
||||
if (match !== null) {
|
||||
rewriteTarget = evaluateRewriteRule(parsedUrl, match, rewrite.to, req);
|
||||
|
||||
if(rewriteTarget.charAt(0) !== '/') {
|
||||
logger(
|
||||
'We recommend using an absolute path for the rewrite target.',
|
||||
'Received a non-absolute rewrite target',
|
||||
rewriteTarget,
|
||||
'for URL',
|
||||
req.url
|
||||
);
|
||||
}
|
||||
|
||||
logger('Rewriting', req.method, req.url, 'to', rewriteTarget);
|
||||
req.url = rewriteTarget;
|
||||
return next();
|
||||
@@ -79,7 +90,7 @@ function evaluateRewriteRule(parsedUrl, match, rule, req) {
|
||||
if (typeof rule === 'string') {
|
||||
return rule;
|
||||
} else if (typeof rule !== 'function') {
|
||||
throw new Error('Rewrite rule can only be of type string of function.');
|
||||
throw new Error('Rewrite rule can only be of type string or function.');
|
||||
}
|
||||
|
||||
return rule({
|
||||
|
||||
+6
-6
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "connect-history-api-fallback@^1.3.0",
|
||||
"_id": "connect-history-api-fallback@1.5.0",
|
||||
"_id": "connect-history-api-fallback@1.6.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-sGhzk0vF40T+9hGhlqb6rgruAVo=",
|
||||
"_integrity": "sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==",
|
||||
"_location": "/connect-history-api-fallback",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"_requiredBy": [
|
||||
"/webpack-dev-server"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.5.0.tgz",
|
||||
"_shasum": "b06873934bc5e344fef611a196a6faae0aee015a",
|
||||
"_resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz",
|
||||
"_shasum": "8b32089359308d111115d81cad3fceab888f97bc",
|
||||
"_spec": "connect-history-api-fallback@^1.3.0",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\webpack-dev-server",
|
||||
"author": {
|
||||
@@ -42,7 +42,7 @@
|
||||
"description": "Provides a fallback for non-existing directories so that the HTML 5 history API can be used.",
|
||||
"devDependencies": {
|
||||
"eslint": "^0.18.0",
|
||||
"nodeunit": "^0.9.1",
|
||||
"nodeunit": "^0.11.3",
|
||||
"sinon": "^1.14.1"
|
||||
},
|
||||
"engines": {
|
||||
@@ -69,5 +69,5 @@
|
||||
"scripts": {
|
||||
"test": "eslint lib/index.js test/index_test.js && nodeunit test/index_test.js"
|
||||
},
|
||||
"version": "1.5.0"
|
||||
"version": "1.6.0"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user