diff --git a/index.js b/index.js index 6038d8b..d47997c 100644 --- a/index.js +++ b/index.js @@ -7,14 +7,14 @@ module.exports = { return next(); } - var key = req.prerender.url; + var key = req.prerender.url.replace(/\//g, '\\'); if (process.env.S3_PREFIX_KEY) { key = process.env.S3_PREFIX_KEY + '/' + key; } s3.getObject({ - Key: key + Key: key }, function (err, result) { if (!err && result) { @@ -30,8 +30,8 @@ module.exports = { return next(); } - var key = req.prerender.url; - + var key = req.prerender.url.replace(/\//g, '\\'); + if (process.env.S3_PREFIX_KEY) { key = process.env.S3_PREFIX_KEY + '/' + key; } @@ -48,4 +48,4 @@ module.exports = { next(); }); } -}; \ No newline at end of file +};