Remove auto-index function
This commit is contained in:
		@ -7,7 +7,6 @@
 | 
			
		||||
      { "source": "/api/public-key", "function": "servePublicKey" },
 | 
			
		||||
      { "source": "/api/stats", "function": "serveStats" },
 | 
			
		||||
      { "source": "/", "function": "serveMainPage" },
 | 
			
		||||
      { "source": "**/", "function": "serveAutoIndexPage" },
 | 
			
		||||
      { "source": "**", "function": "serveNpmPackageFile" }
 | 
			
		||||
    ]
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,6 @@
 | 
			
		||||
import { https } from 'firebase-functions';
 | 
			
		||||
 | 
			
		||||
// import serveAuth from './serveAuth';
 | 
			
		||||
import serveAutoIndexPage from './serveAutoIndexPage';
 | 
			
		||||
import serveMainPage from './serveMainPage';
 | 
			
		||||
import serveNpmPackageFile from './serveNpmPackageFile';
 | 
			
		||||
import servePublicKey from './servePublicKey';
 | 
			
		||||
@ -9,7 +8,6 @@ import serveStats from './serveStats';
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  // serveAuth: https.onRequest(serveAuth),
 | 
			
		||||
  serveAutoIndexPage: https.onRequest(serveAutoIndexPage),
 | 
			
		||||
  serveMainPage: https.onRequest(serveMainPage),
 | 
			
		||||
  serveNpmPackageFile: https.onRequest(serveNpmPackageFile),
 | 
			
		||||
  servePublicKey: https.onRequest(servePublicKey),
 | 
			
		||||
 | 
			
		||||
@ -1,27 +0,0 @@
 | 
			
		||||
import express from 'express';
 | 
			
		||||
import cors from 'cors';
 | 
			
		||||
 | 
			
		||||
// import checkBlacklist from '../middleware/checkBlacklist';
 | 
			
		||||
import fetchPackage from '../middleware/fetchPackage';
 | 
			
		||||
import findFile from '../middleware/findFile';
 | 
			
		||||
import redirectLegacyURLs from '../middleware/redirectLegacyURLs';
 | 
			
		||||
import validatePackageURL from '../middleware/validatePackageURL';
 | 
			
		||||
import validatePackageName from '../middleware/validatePackageName';
 | 
			
		||||
import validateQuery from '../middleware/validateQuery';
 | 
			
		||||
import serveAutoIndexPage from '../actions/serveAutoIndexPage';
 | 
			
		||||
 | 
			
		||||
const app = express();
 | 
			
		||||
 | 
			
		||||
app.disable('x-powered-by');
 | 
			
		||||
 | 
			
		||||
app.use(cors());
 | 
			
		||||
app.use(redirectLegacyURLs);
 | 
			
		||||
app.use(validatePackageURL);
 | 
			
		||||
app.use(validatePackageName);
 | 
			
		||||
app.use(validateQuery);
 | 
			
		||||
// app.use(checkBlacklist);
 | 
			
		||||
app.use(fetchPackage);
 | 
			
		||||
app.use(findFile);
 | 
			
		||||
app.use(serveAutoIndexPage);
 | 
			
		||||
 | 
			
		||||
export default app;
 | 
			
		||||
@ -87,7 +87,6 @@ const functions = [
 | 
			
		||||
].concat(
 | 
			
		||||
  [
 | 
			
		||||
    // 'serveAuth',
 | 
			
		||||
    'serveAutoIndexPage',
 | 
			
		||||
    'serveMainPage',
 | 
			
		||||
    'serveNpmPackageFile',
 | 
			
		||||
    'servePublicKey',
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user