Comparing version 1.2.0 to 1.2.1
10
index.js
@@ -58,8 +58,12 @@ var url = require('url') | ||
function resolveRoot (route) { | ||
if (!route || !opts.root) return route | ||
if (!route || !opts.root) { | ||
return route.replace(/\/$/, '') | ||
} | ||
if (route.url) { | ||
route.url = url.resolve(opts.root, route.url) | ||
route.url = url.resolve(opts.root, route.url).replace(/\/$/, '') | ||
return route | ||
} | ||
return url.resolve(opts.root, route) | ||
return url.resolve(opts.root, route).replace(/\/$/, '') | ||
} | ||
@@ -66,0 +70,0 @@ |
{ | ||
"name": "cccpurge", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Choo Cloudflare Cache Purge – purge all routes served by choo app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
7267
93