Do not serve index.html files at / URLs

This actually broke some old behavior in packages that publish
index.html files but aren't counting on unpkg to serve them.

Closes #130
This commit is contained in:
Michael Jackson 2018-09-24 10:36:05 -07:00
parent 5fac968215
commit 9dbe412783
1 changed files with 0 additions and 4 deletions

View File

@ -84,10 +84,6 @@ function searchEntries(tarballStream, entryName, wantsIndex) {
// and the client wants HTML.
if (
entry.name === entryName ||
// Allow accessing e.g. `/index.html` using `/`
(wantsIndex &&
entry.name ===
(entryName === "" ? "index.html" : `${entryName}/index.html`)) ||
// Allow accessing e.g. `/index.js` or `/index.json` using
// `/index` for compatibility with CommonJS
(!wantsIndex && entry.name === `${entryName}.js`) ||