Merge branch 'vamshi29292-master'

This commit is contained in:
Michael Jackson 2018-12-20 20:02:38 -08:00
commit 4839d84a5a
1 changed files with 2 additions and 0 deletions

View File

@ -118,6 +118,7 @@ function searchEntries(tarballStream, entryName, wantsIndex) {
const leadingSlash = /^\//;
const trailingSlash = /\/$/;
const multipleSlash = /\/\/+/;
/**
* Fetch and search the archive to try and find the requested file.
@ -126,6 +127,7 @@ const trailingSlash = /\/$/;
function findFile(req, res, next) {
fetchNpmPackage(req.packageConfig).then(tarballStream => {
const entryName = req.filename
.replace(multipleSlash, '/')
.replace(trailingSlash, '')
.replace(leadingSlash, '');
const wantsIndex = trailingSlash.test(req.filename);