Comparing version 1.0.16 to 1.0.17
@@ -158,2 +158,3 @@ const fs = require('fs'); | ||
let extns = ['']; | ||
let pathname = parse(req).pathname; | ||
let val = req.headers['accept-encoding'] || ''; | ||
@@ -164,3 +165,7 @@ if (gzips && val.includes('gzip')) extns.unshift(...gzips); | ||
let pathname = typeof req._decoded === 'string' ? req._decoded : parse(req, true).pathname; | ||
if (pathname.indexOf('%') !== -1) { | ||
try { pathname = decodeURIComponent(pathname) } | ||
catch (err) { /* malform uri */ } | ||
} | ||
let data = lookup(pathname, extns) || isSPA && !isMatch(pathname, ignores) && lookup(fallback, extns); | ||
@@ -167,0 +172,0 @@ if (!data) return next ? next() : isNotFound(req, res); |
{ | ||
"name": "sirv", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "The optimized & lightweight middleware for serving requests to static assets", | ||
@@ -23,3 +23,3 @@ "repository": "lukeed/sirv", | ||
"dependencies": { | ||
"@polka/url": "^1.0.0-next.19", | ||
"@polka/url": "^1.0.0-next.20", | ||
"mime": "^2.3.1", | ||
@@ -26,0 +26,0 @@ "totalist": "^1.0.0" |
Sorry, the diff of this file is not supported yet
20764
322
Updated@polka/url@^1.0.0-next.20