serve-handler
Advanced tools
Comparing version 3.1.1 to 3.1.2
{ | ||
"name": "serve-handler", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "The routing foundation of `serve` and static deployments on Now", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -98,2 +98,4 @@ // Native | ||
const ensureSlashStart = target => (target.startsWith('/') ? target : `/${target}`); | ||
const shouldRedirect = (decodedPath, {redirects = [], trailingSlash}, cleanUrl) => { | ||
@@ -138,3 +140,3 @@ const slashing = typeof trailingSlash === 'boolean'; | ||
return { | ||
target, | ||
target: ensureSlashStart(target), | ||
statusCode: defaultType | ||
@@ -147,3 +149,3 @@ }; | ||
return { | ||
target: decodedPath, | ||
target: ensureSlashStart(decodedPath), | ||
statusCode: defaultType | ||
@@ -150,0 +152,0 @@ }; |
34545
509